Skip to content

Add CrossCompat migration rule that produces code which cross-compiles with 2.12- #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
julienrf opened this issue Apr 25, 2018 · 2 comments · Fixed by #72
Closed

Add CrossCompat migration rule that produces code which cross-compiles with 2.12- #19

julienrf opened this issue Apr 25, 2018 · 2 comments · Fixed by #72
Milestone

Comments

@julienrf
Copy link
Contributor

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.
@julienrf julienrf added this to the 2.13.0-M5 milestone Jun 22, 2018
@MasseGuillaume
Copy link
Contributor

If a migration can be cross-compiled (for example, CanBuildFrom), do you want to have two versions of that migration: one that compiles only to 2.13 and one that cross-compile?

@julienrf
Copy link
Contributor Author

@MasseGuillaume the CanBuildFrom migration does not produce code that compiles with 2.12. You have to add an import scala.collection.compat._ first to be able to compile the code on 2.12. Therefore, I think the CrossCompat migration rule should reuse the same CanBuildFrom migration rule, but add the required import to make it compile with 2.12. Does that make sense?

julienrf added a commit that referenced this issue Jun 29, 2018
Major Rewrite refactor: fix #19, fix #56
martijnhoekstra pushed a commit to martijnhoekstra/scala-collection-compat that referenced this issue Nov 9, 2022
Fix MultiSet#toString and MultiDict#toString
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants