-
Notifications
You must be signed in to change notification settings - Fork 1.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
Improve message for discarded pure non-Unit values #18723
Conversation
23594b1
to
b64aa8e
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.
does this also work for #18408?
Yes, it also fixes that issue. I will add it to the tests. |
a057274
to
d82a328
Compare
does this still need to be a draft? |
d82a328
to
7451a18
Compare
I added a second commit with some extra cleanups. Now it is ready for review. |
@@ -1,7 +1,7 @@ | |||
-- [E129] Potential Issue Warning: tests/neg-macros/annot-suspend-cycle/Macro.scala:7:4 -------------------------------- | |||
7 | new Foo | |||
| ^^^^^^^ | |||
| A pure expression does nothing in statement position; you may be omitting necessary parentheses | |||
| A pure expression does nothing in statement position |
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.
This one might not be correct. I will double check it.
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.
It is correct. Class Foo
has a pure constructor.
The `you may be omitting necessary parentheses` hint in the message was added when we used to get method references that became lambdas in statement positions. Now these are an error and never reach this warning.
5c43c66
to
7f48230
Compare
Fixes #18408
Fixes #18722