Skip to content

-Wunused gives false positives on unused explicit parameters of (non-explicitly declared) overridden methods #16865

Closed
@markehammons

Description

@markehammons

Compiler version

3.3.0-RC2

Minimized code

trait Base:
  def fn(a: Int, b: Int): Int 

object Ex extends Base:
  //false positive unused parameter
  def fn(a: Int, b: Int): Int = b + 3

object Ex2 extends Base:
  override def fn(a: Int, b: Int): Int = b + 3

Output

The compiler reports that fn in Ex has an unused explicit parameter a. This is the truth, but fn is an undeclared override of fn from Base.

Expectation

Either that the compiler doesn't warn, or complains that the user hasn't declared the override explicitly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:lintingLinting warnings enabled with -W or -Xlintitype:bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions