@@ -140,6 +140,9 @@ trait Stable212Base extends CrossCompatibility { self: SemanticRule =>
140
140
case Term .Name (value) => value.last != ':'
141
141
case _ => false
142
142
}
143
+
144
+ val `Future.sequence` = SymbolMatcher .exact(Symbol (" _root_.scala.concurrent.Future.sequence(Lscala/collection/TraversableOnce;Lscala/collection/generic/CanBuildFrom;Lscala/concurrent/ExecutionContext;)Lscala/concurrent/Future;." ))
145
+ val `Future.traverse` = SymbolMatcher .exact(Symbol (" _root_.scala.concurrent.Future.traverse(Lscala/collection/TraversableOnce;Lscala/Function1;Lscala/collection/generic/CanBuildFrom;Lscala/concurrent/ExecutionContext;)Lscala/concurrent/Future;." ))
143
146
}
144
147
145
148
@@ -190,6 +193,11 @@ trait Stable212Base extends CrossCompatibility { self: SemanticRule =>
190
193
sharedPatch + toColl
191
194
}
192
195
196
+ def fixFuture (breakout : Tree ): Patch = {
197
+ val toCollection = extractColFromBreakout(breakout).syntax
198
+ ctx.replaceTree(breakout, toCollection)
199
+ }
200
+
193
201
def extractColFromBreakout (breakout : Tree ): Term = {
194
202
val synth = ctx.index.synthetics.find(_.position.end == breakout.pos.end).get
195
203
val Term .Apply (_, List (implicitCbf)) = synth.text.parse[Term ].get
@@ -262,6 +270,14 @@ trait Stable212Base extends CrossCompatibility { self: SemanticRule =>
262
270
case ap0 @ Term .Apply (ap @ Term .Apply (Term .Apply (Term .Select (lhs, `TraversableLike.scanLeft`(op)), _), _), List (breakOut(bo))) =>
263
271
fixIt(" iterator" , lhs, ap, bo, ap0)
264
272
273
+ // sequence(xs)(breakOut, ec)
274
+ case Term .Apply (Term .Apply (`Future.sequence`(_), _), List (breakOut(bo), _)) =>
275
+ fixFuture(bo)
276
+
277
+ // traverse(xs)(f)(breakOut, ec)
278
+ case Term .Apply (Term .Apply (Term .Apply (`Future.traverse`(_),_), _), List (breakOut(bo), _)) =>
279
+ fixFuture(bo)
280
+
265
281
case i : Importee if breakOut.matches(i) =>
266
282
breakOutImports += i
267
283
Patch .empty
0 commit comments