-
Notifications
You must be signed in to change notification settings - Fork 21
Make -Ywarn-unused:params
sensitive to usages in extending classes
#11343
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
Comments
scala/scala#5402 for default getters |
@som-snytt should this stay open? I transferred it from scala-dev |
The second case still warns. The improvement is to (optionally) warn only for sealed or final classes, if param is used in no override. Don't warn (optionally) for abstract classes. |
Relatedly, unused ctor of "effectively sealed" (sealed/private) class does not warn. Under the rubric of things to notice about such classes. |
I would not consider that a bug. Or rather, I would require convincing? The parameter is in fact unused. The fact that Scala 3 also warns in this case.
I doubt this level of ambition is desirable. There aren't other places in unused analysis where you do this kind of inter-class analysis.... are there? |
-Ywarn-unused:params
sensitive to usages in extending classes
The sentiment at one point (maybe Jason said something) was that warning for unused params would be too noisy to be useful. I would like all the unused warnings to be lints, just because remembering which are enabled by |
Hmm. Maybe in Scala 3 I'll conclude that |
Currently, an override is absolved (for unused param) because you can't change the signature you inherit. Closing because not inclined to convince Seth (by plying him with beers). The nowarn and WConf facilities obviate too much cleverness. Probably the other heuristics to mitigate warnings should be removed, except for simple "RHS is ???". |
Tweaks to linting params as noted by @lrytz on community build.
The text was updated successfully, but these errors were encountered: