File tree Expand file tree Collapse file tree 3 files changed +15
-15
lines changed
output/src/main/scala/fix Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -14,4 +14,7 @@ object ReplaceToSrc {
1414
1515 def m2 (xs : List [Int ]): Iterable [Int ] =
1616 xs.to
17+
18+ def f (xs : List [Int ]): Unit = ()
19+ f(Set (1 ).to)
1720}
Original file line number Diff line number Diff line change @@ -15,4 +15,7 @@ object ReplaceToSrc {
1515
1616 def m2 (xs : List [Int ]): Iterable [Int ] =
1717 xs.to(scala.collection.immutable.IndexedSeq )
18+
19+ def f (xs : List [Int ]): Unit = ()
20+ f(Set (1 ).to(scala.collection.immutable.List ))
1821}
Original file line number Diff line number Diff line change @@ -273,22 +273,16 @@ trait Stable212Base extends CrossCompatibility { self: SemanticRule =>
273273 }.asPatch
274274
275275 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
281284 }
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)
292286
293287 }.asPatch
294288
You can’t perform that action at this time.
0 commit comments