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