-
Notifications
You must be signed in to change notification settings - Fork 21
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
Disallow @deprecated without message/version #9079
Comments
Imported From: https://issues.scala-lang.org/browse/SI-9079?orig=1 |
Would a PR on this accepted? https://github.com/scala/scala/blob/v2.13.0-M3/src/library/scala/deprecated.scala |
the "softer landing" option sgtm. (it's always tempting to cut out the deprecation step, but in general I think we should only consider that if there's some special advantage to it, like if keeping the deprecated thing has some real extra cost. I don't see that applying here) |
How is second approach better than first here? |
I think you have to feel strongly about this issue to force the extra args. Probably only soc felt that strongly. Consider that deprecations sit around forever. What does the The existing warning is already obnoxious. Folks know to use
I want Also, annotations that don't complain with constant args out of order. That's another ticket. |
@som-snytt
In the Scala library, they do not (see scala/scala#6319). Leaving out |
@mghildiy Are you still working on this? |
@NthPortal I'm not arguing to remove If the Scala library wants to lint its usage of But it's not necessary to make the rest of us follow a narrow use case for Java now distinguishes between "ordinarily deprecated" and "terminally deprecated" (the language in 9.6.4.6 of the spec), based on Deprecations since But other improvements are possible besides "require two strings". The Scaladoc also offers dubious advice about the format of the strings. Why should I need to transcribe "mylib 0.5"? The compiler and sbt know what I'm building. I had a plugin to make sure the second string looks like a version and that I didn't mix them up. A reasonable project standard is to require an empty or minimal To require Another possible tooling approach is to Also consider a field like |
There is
I don't have a strong personal-technical opinion about deprecation, so I don't know why I spilled so much virtual ink. My previous usage of deprecation is to add the annotation to tests that test deprecated API, in order to suppress the deprecation warning; that was before the nowarn annotation. I see that the PR included How is deprecation like an erhu? They both "require two strings." |
We really should just outlaw deprecated annotations without message/version. Nothing good comes from it, because it seems the warning already emitted is too easy to ignore.
This is pretty annoying because it means we will be stuck with those elements for another few years. Example: https://github.com/scala/scala/blob/2.11.x/src/library/scala/collection/Iterator.scala#L169
The text was updated successfully, but these errors were encountered: