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
Add linting of unused context bounds (via -Wunused:synthetics
or -Wunused:params
)
#9346
Conversation
7babfd5
to
bc99ccd
Compare
@som-snytt this appears just about ready to merge, but because it adds a new flag, would you mind supplying a nice PR description that explains this from the user's point of view (and without requiring them to follow links), for linking from the release notes? in particular, I'm wondering what the recommended way of suppressing the warning is (and should there be a test that tests that?), since |
I merged it already, but I think this would be handy to have written down. 🤗 |
I'm always a little hesitant about letting flags proliferate, but this is an area where it's probably harmless and will benefit at least some users. I just had a look at sbt-tpolecat and it does enable |
-Wunused:synthetics
or -Wunused:params
)
oh heh nm, I see you thanked him on Gitter 👍 |
Warn under
-Wunused:synthetics
which is included by-Wunused:params
.Warnings for unused value parameters can be selectively enabled.
-Xlint
enables-Wunused:implicits
to warn about unused implicit parameters. Warnings about ordinary parameters can be enabled with-Wunused:explicits
; that is deemed noisy for ordinary use, so it is not enabled by-Xlint
. Now, "unused context bounds", which are synthetic parameters, can be detected by enabling-Wunused:synthetics
. All three warnings are enabled by-Wunused:params
.Fixes scala/bug#10349