Skip to content
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

Fixes for akka rewrite #100

Closed
wants to merge 2 commits into from
Closed

Conversation

MasseGuillaume
Copy link
Contributor

@MasseGuillaume MasseGuillaume commented Jul 17, 2018

fix #87

With those changes, we can run the CrossCompat on Akka and compile the code without warning/errors and pass all the test.

Diff here:
MasseGuillaume/akka@279fa62

MasseGuillaume added a commit to MasseGuillaume/akka that referenced this pull request Jul 17, 2018
ran

scalafix scala:fix.CrossCompat
test:scalafix scala:fix.CrossCompat

with

scala/scala-collection-compat#100

object LinearSeqSrc {
LinearSeq(1)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should still support this case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still, I don’t understand why we remove it. We should leave it and improve/fix it later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, if it's incorrect we should remove it. I'm using it to migrate akka, if we keep this rewrite in It's not possible to use scala-collection-compat to rewrite code.

@@ -45,17 +45,21 @@ trait Stable212Base extends CrossCompatibility { self: SemanticRule =>
val traversable = exact(
"_root_.scala.package.Traversable#",
"_root_.scala.collection.Traversable#",
"_root_.scala.package.Iterable#",
"_root_.scala.collection.Iterable#"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we remove these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use this to detect if we need to add the compat import for

     ctx.replaceSymbols(
        "scala.Traversable"            -> "scala.Iterable",
        "scala.collection.Traversable" -> "scala.collection.Iterable"
      )

It was incorrectly adding compat import.

val linearSeqToList =
ctx.replaceSymbols(
"scala.collection.LinearSeq" -> "scala.collection.immutable.List",
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this rule?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

martijnhoekstra pushed a commit to martijnhoekstra/scala-collection-compat that referenced this pull request Nov 9, 2022
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 this pull request may close these issues.

CrossCompat add compat import only if a symbol is replaced.
2 participants