scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
230 stars 21 forks source link

`-Wunused:params` doesn't report on unused param in 2.13.9+ #12838

Closed mrdziuban closed 8 months ago

mrdziuban commented 11 months ago

Reproduction steps

Scala version: 2.13.9 and up

https://scastie.scala-lang.org/mrdziuban/P84IrKNoS8OP8Y1llFIzOw

def text(x: Int): Int = 1

Problem

x should be reported as unused

som-snytt commented 11 months ago

This is an intentional heuristic, not to warn about trivial RHS, to make the warning less noisy.

There is a PR-in-waiting that adds an option to control whether these heuristics are applied.

I'll leave this ticket unclosed for the moment.

mrdziuban commented 11 months ago

Thanks for the info @som-snytt!

som-snytt commented 8 months ago

The knob is not available yet. Closing as duplicate for that feature.