@@ -13,15 +13,14 @@ import util.{Property, SourceFile, SourcePosition, SrcPos, Chars}
1313import config .{Feature , Config }
1414import config .Feature .{sourceVersion , migrateTo3 , enabled }
1515import config .SourceVersion .*
16- import collection .mutable
16+ import collection .mutable , mutable . ListBuffer
1717import reporting .*
1818import printing .Formatting .hl
1919import config .Printers
2020import parsing .Parsers
21- import dotty . tools . dotc . util .chaining .*
21+ import util .chaining .*
2222
2323import scala .annotation .{unchecked as _ , * }, internal .sharable
24- import scala .collection .mutable , mutable .ListBuffer
2524
2625object desugar {
2726 import untpd .*
@@ -2234,7 +2233,7 @@ object desugar {
22342233 case (Tuple (ts1), Tuple (ts2)) => ts1.corresponds(ts2)(deepEquals)
22352234 case _ => false
22362235
2237- def markTrailingMap (aply : Apply , gen : GenFrom , selectName : TermName , body : Tree ): Unit =
2236+ def markTrailingMap (aply : Apply , gen : GenFrom , selectName : TermName ): Unit =
22382237 if sourceVersion.enablesBetterFors
22392238 && selectName == mapName
22402239 && gen.checkMode != GenCheckMode .Filtered // results of withFilter have the wrong type
@@ -2246,7 +2245,7 @@ object desugar {
22462245 case Nil if sourceVersion.enablesBetterFors => body
22472246 case (gen : GenFrom ) :: Nil =>
22482247 Apply (rhsSelect(gen, mapName), makeLambda(gen, body))
2249- .tap(markTrailingMap(_, gen, mapName, body ))
2248+ .tap(markTrailingMap(_, gen, mapName))
22502249 case (gen : GenFrom ) :: (rest @ (GenFrom (_, _, _) :: _)) =>
22512250 val cont = makeFor(mapName, flatMapName, rest, body)
22522251 Apply (rhsSelect(gen, flatMapName), makeLambda(gen, cont))
@@ -2263,7 +2262,6 @@ object desugar {
22632262 if suffix.exists(_.isInstanceOf [GenFrom ]) then flatMapName
22642263 else mapName
22652264 Apply (rhsSelect(gen, selectName), makeLambda(gen, cont))
2266- .tap(markTrailingMap(_, gen, selectName, cont))
22672265 else
22682266 val (pats, rhss) = valeqs.map { case GenAlias (pat, rhs) => (pat, rhs) }.unzip
22692267 val (defpat0, id0) = makeIdPat(gen.pat)
0 commit comments