@@ -23,7 +23,8 @@ case class Collectionstrawman_v0(sctx: SemanticCtx)
23
23
24
24
val additionalUnimports = Map (
25
25
" augmentString" -> " wrapString" ,
26
- " wrapString" -> " augmentString"
26
+ " wrapString" -> " augmentString" ,
27
+ " intArrayOps" -> " genericArrayOps"
27
28
)
28
29
29
30
def replaceExtensionMethods (ctx : RewriteCtx ): Patch = {
@@ -33,8 +34,7 @@ case class Collectionstrawman_v0(sctx: SemanticCtx)
33
34
out <- unimports.get(in).toList
34
35
} yield {
35
36
val name = in.name
36
- val names = name :: additionalUnimports
37
- .get(name)
37
+ val names = name :: additionalUnimports.get(name)
38
38
.fold(List .empty[String ])(_ :: Nil )
39
39
ctx.addGlobalImport(out) +
40
40
ctx.addGlobalImport(
@@ -94,7 +94,6 @@ case class Collectionstrawman_v0(sctx: SemanticCtx)
94
94
s(" Traversable" , Some (" Iterable" )),
95
95
" scala.Iterable" -> " strawman.collection.Iterable" ,
96
96
" scala.Traversable" -> " strawman.collection.Iterable" ,
97
- " scala.collection.TraversableLike.toIterator" -> " iterator" ,
98
97
" scala.`#::`" -> " strawman.collection.immutable.LazyList.`#::`" ,
99
98
s(" Vector" ),
100
99
i(" Vector" ),
@@ -126,13 +125,14 @@ case class Collectionstrawman_v0(sctx: SemanticCtx)
126
125
Symbol (" _root_.scala.collection.TraversableLike.to." )
127
126
)
128
127
val iterator = SymbolMatcher (
129
- Symbol (" _root_.scala.collection.LinearSeqLike.iterator." )
128
+ Symbol (" _root_.scala.collection.LinearSeqLike.iterator." ),
129
+ Symbol (" _root_.scala.collection.TraversableLike.toIterator." )
130
130
)
131
131
132
132
def replaceToList (ctx : RewriteCtx ) =
133
133
ctx.tree.collect {
134
134
case iterator(n : Name , _) =>
135
- ctx.addRight(n.tokens.last , " ()" )
135
+ ctx.replaceTree(n , " iterator ()" )
136
136
case toImmutableX(n : Name , s) =>
137
137
ctx.replaceTree(n, s " to(strawman.collection.immutable. ${s.name.stripPrefix(" to" )}) " )
138
138
case toGenericX(n : Name , s) =>
0 commit comments