The NewCollections migration rule produces code that only compiles with Scala 2.13.0. This is fine for applications, but libraries usually cross compile to several Scala versions.
We should add another migration rule (e.g. CrossCompat), which would produce code that happily cross-compiles with all the Scala versions supported by the scala-collection-compat module.
Compared to the NewCollections rule, the CrossCompat rule should:
- apply a subset of the rewrites that produces code compiling with 2.12-, or code supported by the compat library,
- add an import to
scala.collection.compat._ when necessary.