-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Disallow synthesized lambdas in statement position #11769
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
Disallow lambdas in statement position or if the expected type is Unit. Fixes scala#11671
For user-written lambdas, presumably the devs know what they are doing. User-written numbers aappear in quite a lot of test cases. A second change of this commit is that closure methods now get a more accurate span.
There are two utest tests that fail. Unfortunately the assertions fail without any info and I don't know enough about utest to figure out what went wrong. Somebody who knows utest should follow up on this.
This looks like a simple fix that makes sense, but it has been nightmarish since it seems all testing frameworks hate me now. There are two utest tests that fail where I am stuck. Unfortunately the assertions fail without |
The latest iteration of this does allow user-defined lambdas in statement position even though they don't make sense since |
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!
I took a look and proposed a fix in #11887. |
Community build: Adapt utest for #11769
Disallow lambdas in statement position or if the expected type is Unit. This was a loophole that opened up due to the changes to eta expansion in Scala 3. We did get a warning in these cases, but an error might be better.
Fixes #11761