Skip to content

nowarn falsely reports "annotation does not suppress any warnings" when suppressing unused private members #19992

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

Closed
felher opened this issue Mar 20, 2024 · 1 comment
Labels
area:linting Linting warnings enabled with -W or -Xlint area:reporting Error reporting including formatting, implicit suggestions, etc itype:bug stat:duplicate

Comments

@felher
Copy link
Contributor

felher commented Mar 20, 2024

Compiler version

3.3.3

Minimized code

@scala.annotation.nowarn()
object Test:
  private val aa = "aa"

Scastie at https://scastie.scala-lang.org/OVJH4ESRR4iswVLoeyay2A

Output

@nowarn annotation does not suppress any warnings

Expectation

Should not output a warning since it suppresses a "unused private member" warning that would appear otherwise.

Similar to

Maybe a duplicate of #18341 ?

@felher felher added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 20, 2024
@felher felher changed the title annotation.nowarn falsely reports "annotation does not suppress any warnings" when suppressing unused private members nowarn falsely reports "annotation does not suppress any warnings" when suppressing unused private members Mar 20, 2024
@Gedochao Gedochao added area:reporting Error reporting including formatting, implicit suggestions, etc area:linting Linting warnings enabled with -W or -Xlint stat:duplicate and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Apr 3, 2024
@Gedochao
Copy link
Contributor

Gedochao commented Apr 3, 2024

Maybe a duplicate of #18341 ?

Seems to be the case.
I'm closing this, let's track it under #18341

@Gedochao Gedochao closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:linting Linting warnings enabled with -W or -Xlint area:reporting Error reporting including formatting, implicit suggestions, etc itype:bug stat:duplicate
Projects
None yet
Development

No branches or pull requests

2 participants