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

Treat java / scala deprecated annotations more uniformly #8883

Closed
scabug opened this issue Oct 6, 2014 · 3 comments
Closed

Treat java / scala deprecated annotations more uniformly #8883

scabug opened this issue Oct 6, 2014 · 3 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Oct 6, 2014

There seem to be a some of inconsistencies in the way we deprecation annotations.

  • Should the scala @deprecated add the Java annotation @Deprecated, or just the ACC_DEPRECATED flag?
  • Adding Java's @Deprecated to a Scala class does not trigger any deprecation warnings (neither in scalac nor in javac)

etc.

@scabug
Copy link
Author

scabug commented Oct 6, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8883?orig=1
Reporter: @lrytz
Affected Versions: 2.11.2

@scabug
Copy link
Author

scabug commented Oct 7, 2014

@soc said (edited on Oct 7, 2014 3:08:42 PM UTC):
As far as I see, @Deprecated being added to the RuntimeVisibleAttribute is just because it is defined with RetentionPolicy RUNTIME, but ACC_DEPRECATED is the only thing that counts semantically.

From the declaration of @deprecated it is just a "source annotation". I wouldn't bother introducing another special case, especially because the attribute really just records whether "annotation X was here" and doesn't carry any semantic meaning.

If we want @deprecated to show up, we should make it extend the appropriate Annotation type in Scala.

Whether we'd like to support @Deprecated is an interesting question.

By the way, maybe we can just type alias @Deprecated to @deprecated in Scala? That might be a much simpler approach.

@dwijnand
Copy link
Member

scala/scala#8781

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