Skip to content

-Wunused ignores annotations extended from unused #17378

@soronpo

Description

@soronpo

Works properly in Scala 2.13.10 (with -Xlint:unused)

Compiler version

v3.3.0-RC5

Minimized code

//> using scala "3.3.0-RC4"
//> using option "-Wunused:all"
import scala.annotation.unused

class extunused extends unused("extended")

def hithere: Unit = {
  @extunused
  val x = 1
  print("hi")
}

Output

[warn] .\test1.sc:9:7: unused local definition
[warn]   val x = 1

Expectation

No warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions