Skip to content

-Wunused:nowarn falsely reports that an annotation does not suppress any warnings #18341

Closed
@mrdziuban

Description

@mrdziuban

Compiler version

3.3.0, also happens in latest 3.3.1-RC4

Minimized code

https://scastie.scala-lang.org/mrdziuban/r3gWMzhnQzWsGcUEtiNtbw/1

class Foo(@annotation.nowarn("msg=unused") x: Int)

Output

@nowarn annotation does not suppress any warnings

but removing the annotation results in a warning

unused explicit parameter

Expectation

There should be no warning on the nowarn annotation as it does suppress the unused explicit parameter warning.

Metadata

Metadata

Assignees

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