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
-Wunused:params don't work for unimplemented methods #12592
Comments
@som-snytt I feel like I'm vaguely remembering you did this intentionally? |
Yes, that is a long-time feature that was recently augmented under #11856 Maybe when the compiler options page is refreshed, linting behavior could be expanded upon, or I guess the word is expatiated. Although there lints that can be selected, the general goal is to avoid many knobs and levers, and find a sweet spot that is useful but not noisy, so that Maybe someone will get back to scala/docs.scala-lang#1711 |
@som-snytt So just to clarify - it's intended behavior, that in the case of unimplemented methods (with '???') these parameters are not being reported as unused, correct? |
|
The design justification is that If that design decision doesn't suit your codebase's needs, consider adding a Scalafix rule to your build (or use Wartremover or whatever) that complains if |
Thanks, all clear now. |
Reproduction steps
Scala version: 2.13.8
with the compiler option
"-Wunused:params"
(or with
"-Wunused:explicits", "-Wunused:implicits", "-Wunused:synthetics"
)Problem
I expect the unused implicit, explicit and context bound parameters to be reported as 'never used' for each method respectively, but there are no warnings for these unimplemented methods (so the specific example in the implementing PR does not actually produce warnings, as those methods are also unimplemented with
???
). If the methods are implemented to e.g. return1
, the expected warnings are produced.The text was updated successfully, but these errors were encountered: