@@ -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 .*
@@ -2236,7 +2235,7 @@ object desugar {
22362235 case (Tuple (ts1), Tuple (ts2)) => ts1.corresponds(ts2)(deepEquals)
22372236 case _ => false
22382237
2239- def markTrailingMap (aply : Apply , gen : GenFrom , selectName : TermName , body : Tree ): Unit =
2238+ def markTrailingMap (aply : Apply , gen : GenFrom , selectName : TermName ): Unit =
22402239 if sourceVersion.enablesBetterFors
22412240 && selectName == mapName
22422241 && gen.checkMode != GenCheckMode .Filtered // results of withFilter have the wrong type
@@ -2248,7 +2247,7 @@ object desugar {
22482247 case Nil if sourceVersion.enablesBetterFors => body
22492248 case (gen : GenFrom ) :: Nil =>
22502249 Apply (rhsSelect(gen, mapName), makeLambda(gen, body))
2251- .tap(markTrailingMap(_, gen, mapName, body ))
2250+ .tap(markTrailingMap(_, gen, mapName))
22522251 case (gen : GenFrom ) :: (rest @ (GenFrom (_, _, _) :: _)) =>
22532252 val cont = makeFor(mapName, flatMapName, rest, body)
22542253 Apply (rhsSelect(gen, flatMapName), makeLambda(gen, cont))
@@ -2265,7 +2264,6 @@ object desugar {
22652264 if suffix.exists(_.isInstanceOf [GenFrom ]) then flatMapName
22662265 else mapName
22672266 Apply (rhsSelect(gen, selectName), makeLambda(gen, cont))
2268- .tap(markTrailingMap(_, gen, selectName, cont))
22692267 else
22702268 val (pats, rhss) = valeqs.map { case GenAlias (pat, rhs) => (pat, rhs) }.unzip
22712269 val (defpat0, id0) = makeIdPat(gen.pat)
0 commit comments