File tree 3 files changed +15
-15
lines changed
output/src/main/scala/fix 3 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -14,4 +14,7 @@ object ReplaceToSrc {
14
14
15
15
def m2 (xs : List [Int ]): Iterable [Int ] =
16
16
xs.to
17
+
18
+ def f (xs : List [Int ]): Unit = ()
19
+ f(Set (1 ).to)
17
20
}
Original file line number Diff line number Diff line change @@ -15,4 +15,7 @@ object ReplaceToSrc {
15
15
16
16
def m2 (xs : List [Int ]): Iterable [Int ] =
17
17
xs.to(scala.collection.immutable.IndexedSeq )
18
+
19
+ def f (xs : List [Int ]): Unit = ()
20
+ f(Set (1 ).to(scala.collection.immutable.List ))
18
21
}
Original file line number Diff line number Diff line change @@ -273,22 +273,16 @@ trait Stable212Base extends CrossCompatibility { self: SemanticRule =>
273
273
}.asPatch
274
274
275
275
case t @ Term .Select (_, to @ toTpe(n : Name )) if ! handledTo.contains(n) =>
276
- // we only want f.to, not f.to(X)
277
- val applied =
278
- t.parent match {
279
- case Some (_:Term .Apply ) => true
280
- case _ => false
276
+ val synth = ctx.index.synthetics.find(_.position.end == to.pos.end)
277
+ synth.map{ s =>
278
+ s.text.parse[Term ].get match {
279
+ // we only want f.to, not f.to(X)
280
+ case Term .Apply (_, List (toCol)) =>
281
+ val col = extractCollection(toCol)
282
+ ctx.addRight(to, " (" + col + " )" )
283
+ case _ => Patch .empty
281
284
}
282
-
283
- if (! applied) {
284
- val synth = ctx.index.synthetics.find(_.position.end == to.pos.end)
285
- synth.map{ s =>
286
- val res = s.text.parse[Term ].get
287
- val Term .Apply (_, List (toCol)) = res
288
- val col = extractCollection(toCol)
289
- ctx.addRight(to, " (" + col + " )" )
290
- }.getOrElse(Patch .empty)
291
- } else Patch .empty
285
+ }.getOrElse(Patch .empty)
292
286
293
287
}.asPatch
294
288
You can’t perform that action at this time.
0 commit comments