-
Notifications
You must be signed in to change notification settings - Fork 1.1k
By-name arguments do not behave as expected with right-associative operators #2808
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
Comments
While playing around with a possible solution for 2.13 I realized that |
Here's my implementation of this scheme for 2.13: scala/scala#5969 |
I agree the transformation to
|
Lift the left hand side of a right-associative infix operation only if the operation takes a by-value argument.
Lift the left hand side of a right-associative infix operation only if the operation takes a by-value argument.
Lift the left hand side of a right-associative infix operation only if the operation takes a by-value argument.
Fix #2808: Modify lifting of infix operations
This is the same bug as scala/bug#1980:
This should print nothing but ends up printing foo because we desugar:
foo() m2_: c
into:
In scalac this was basically unfixable because this desugaring is done during parsing, but in dotty we should have the type of
m2_:
during desugaring which tells us that its argument is by-name and thus we could simply do:Whether or not this is fixed might influence the design of the collection strawman: scala/collection-strawman#127
The text was updated successfully, but these errors were encountered: