-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Introducing overloads in value classes no longer creates a binary incompatibilty with client code. #7896
Conversation
Here's a followup after re-starring: https://github.com/retronym/scala/tree/topic/ext-method-overload-restarr |
I wonder why it wasn't done this way initially. 5118fd0d08 |
The SIP doesn't address overloading. Perhaps during Martin's WIP (before the commit to scala/scala) it was just based on "dead reckoning" to the corresponding name, and was then changed to a linear scan of the family of methods to "gain a level of insensitivity of how overloaded types are ordered between phases and picklings.". Once you're doing that scan, you might as well just use overloading, which importantly extends this sensitivity to separate compilation |
d57d0f4
to
e850b08
Compare
This avoids binary incompatibilities when adding/removing/reordering overloaded methods in value classes.
let's restarr before RC1 to get the full fix in |
I don't get the title or this description (and there are no test examples). Could someone give an example of what this change allows now? Thank you. |
@dwijnand Thanks for the feedback, I've updated the title and description. |
@lrytz I asked @odersky last night. He told me the motivation for the suffixes was because Scala's overload resolution only uses the first parameter section, and in all cases that is the
This doesn't really matter in our implementation, because we create the |
See scala/scala#7896 and follow-up scala/scala#7922, we can do both steps at once since we always run with a bootstrapped dotty-library on the classpath, even if the compiler itself is not bootstrapped.
See scala/scala#7896 and follow-up scala/scala#7922, we can do both steps at once since we always run with a bootstrapped dotty-library on the classpath, even if the compiler itself is not bootstrapped.
See scala/scala#7896 and follow-up scala/scala#7922, we can do both steps at once since we always run with a bootstrapped dotty-library on the classpath, even if the compiler itself is not bootstrapped.
See scala/scala#7896 and follow-up scala/scala#7922, we can do both steps at once since we always run with a bootstrapped dotty-library on the classpath, even if the compiler itself is not bootstrapped.
See scala/scala#7896 and follow-up scala/scala#7922, we can do both steps at once since we always run with a bootstrapped dotty-library on the classpath, even if the compiler itself is not bootstrapped.
Prior to this change, the following linkage error could occur.
After this change, we no longer use the
$0
,$1
, ... suffixes for overloaded methods, so we don't have the problem anymore.