Respect java.lang.Deprecated annotation even in Scala sources#10517
Conversation
|
(Thanks! Note that we're currently winding up 2.13.12, so it might be a few weeks before we consider this for 2.13.13.) |
|
I missed this very much, thanks. |
5b03b81 to
4cb2928
Compare
|
It may be confusing to users that both annotations exist and are supported. May I suggest adding something to the Scaladoc for the Scala annotation that explains why one might wish to use it instead of the Java one...? |
|
@kapunga are you interested in coming back to this (see Seth's comment above)? Also, could you extend the existing lint for deprecations to suggest using Currently (with this PR): ➜ sandbox qs -Xlint
Welcome to Scala 2.13.12-20230828-034507-4cb2928 (OpenJDK 64-Bit Server VM, Java 17.0.6).
Type in expressions for evaluation. Or try :help.
scala> @deprecated def f = 1
^
warning: Specify both message and version: @deprecated("message", since = "1.0")
def f: Int
scala> @Deprecated def g = 1
def g: Int
scala> g
^
warning: method g is deprecated
val res0: Int = 1 |
Fixes scala/bug#12845 Removes the restriction of java.lang.Deprecated to just Java source. Also fixes several unit tests. If we are acception @java.lang.Deprecated on Scala files, several partests (t9529, t9644, t9644b) have deprecation warnings in the output. We expect these.
259de48 to
edc977b
Compare
|
Pushed my changes. Review by @som-snytt? |
edc977b to
6280a5b
Compare
som-snytt
left a comment
There was a problem hiding this comment.
Very accommodating. It's possible the commit title at-mentions Herr Edeling.
|
To clarify, Daniel Edeling's handle is "deprecated". |
java.lang.Deprecated annotation even in Scala sources
…ecation Always respect java.lang.Deprecated annotation
…ecation Always respect java.lang.Deprecated annotation
Fixes scala/bug#12845
Removes the restriction of
java.lang.Deprecatedto just Java source.