-
Notifications
You must be signed in to change notification settings - Fork 87
Add more rules to CrossCompile #78
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
Conversation
@julienrf ready for review |
// At that point we know that *at least one* iterator has no next element | ||
// If *both* of them have no elements then the collections are the same | ||
self.hasNext == those.hasNext | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can simply delegate to self.sameElements(that.iterator)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test for this decorator in compat/src/test/scala/
?
@@ -4,6 +4,8 @@ import scalafix._ | |||
import scalafix.util._ | |||
import scala.meta._ | |||
|
|||
import scala.collection.mutable.{Set => MSet} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The recommended practice is to import scala.collection.mutable
and then write mutable.Set
at use site.
@@ -153,6 +157,8 @@ case class CanBuildFromNothing(param: Name, | |||
body.collect { | |||
case ap @ Term.ApplyType(Term.Select(e, to @ toTpe(_)), List(cc2 @ matchCC(_))) => | |||
|
|||
handledTo += to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this code related to the .sameElements
rewrite rule?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain the list of changes performed by this commit in the commit message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CanBuildFrom
and .to[C] => .to(C)
are now in the same Rule. You need to guard the .to rewrite from the one in CanBuildFrom. This PR fix #75 and does more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks good! Can you squash the commit and list the changes in the commit message?
This one is ready for merging. |
Do you mind adding more information about the changes in the commit message? |
It's possible to cross-compile two rewrite rules to[List] => to(List) it.sameElements
Done |
fix #75