Skip to content
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

"annotation is discarded" warning should not be issued if the annotation is erroneous #9559

Closed
scabug opened this issue Nov 17, 2015 · 3 comments

Comments

@scabug
Copy link

scabug commented Nov 17, 2015

scala> class C { @annotation.doesNotExist val foo = 1 }
<console>:7: error: type doesNotExist is not a member of package annotation
       class C { @annotation.doesNotExist val foo = 1 }
                             ^
warning: no valid targets for annotation on value foo - it is discarded unused. You may specify targets with meta-annotations, e.g. @(<error> @getter)
@scabug
Copy link
Author

scabug commented Nov 17, 2015

Imported From: https://issues.scala-lang.org/browse/SI-9559?orig=1
Reporter: @retronym
Affected Versions: 2.11.7

@scabug
Copy link
Author

scabug commented Nov 17, 2015

@retronym said:
Simon, please feel free to reassign to me if you've got enough on your annotation plate!

@som-snytt
Copy link

adriaanm said:

Drop warning on potentially discarded annotations,
I don't think this warrants a warning.

scala/scala@fdc9467#diff-9ba21d0d0af3ea716bcda01fbc338ea8

Maybe a linter could offer such a check. I wonder if scalafix has enough info to warn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants