-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix desugaring of context bounds in extensions #11623
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
I guess the change should avoid breaking #11583 to have a chance... |
d5fbf96
to
e462689
Compare
45c2226
to
0524d25
Compare
I find the main issue here is that this change results in a worse search for eligible extensions (from the same source) than the status quo. |
@bishabosha I think the desugaring is not at fault here since you're going to get the same type inference behavior if you were to write Previous desugaring would merely mask the issue by making context bounds infer "better" by making them more than just a short-hand which they are usually, then cause surprising change in behavior if a context bound was replaced with an explicit |
Sorry, I should perhaps rephrase my original comment, I am in agreement in principle with the new proposed desugaring. However I am concerned that perhaps it should not go forward right now, purely because an extension such as extension [F[_], A](f: F[A])(using Functor[F]) def ... can not be found as easily by the compiler (therefore leading to more boilerplate to put all using clauses at the end of extension methods, a.k.a - how context bounds desugar before this PR). |
Yeah, but you'd lose that property immediately if you wrote an explicit |
00d9fa6
to
8ce882f
Compare
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.
LGTM
Yes, I saw that, thanks |
Should this be revisited now that #11713 is fixed? |
would that be a scala 4 change? |
Fixes #11586
Unfixes #11583