Skip to content
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

Lint runs before purity #20408

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

som-snytt
Copy link
Contributor

Inspired by #16115

Run lint before value discard before purity check.

Just adding -Wvalue-discard provides the requested warning from the ticket.

There are two discard messages:

-- [E175] Potential Issue Warning: i16115.scala:13:4 -------------------------------------------------------------------
13 |  C(K),
   |    ^
   |    discarded non-Unit value of type (E.K : E)

for discard, as opposed to the purity check

-- [E190] Potential Issue Warning: i16115.scala:13:4 -------------------------------------------------------------------
13 |  C(K),
   |    ^
   |    Discarded non-Unit value of type E. You may want to use `()`.
   |
   | longer explanation available when compiling with `-explain`

which could be made uniform.

The message for -Wnonunit-statement is noncommittal:

-- [E176] Potential Issue Warning: i16115.scala:13:4 -------------------------------------------------------------------
13 |  C(K),
   |    ^
   |    unused value of type (E.K : E)

@som-snytt
Copy link
Contributor Author

Suspiciously, no check files required updating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant