-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
case class no longer deprecates itself #10071
case class no longer deprecates itself #10071
Conversation
This is the case (or
That was jroper on scala/bug#8685 |
a1a638e
to
f35539c
Compare
SLS 11.2.3 isn't quite current, but specifies the exclusion for deprecation. The revision would add "...or has a deprecated companion class or module."
|
// or an element that is synthetic or has a deprecated companion. | ||
if (sym.isDeprecated && | ||
(!currentOwner.isSynthetic || currentOwner.isAnonymousFunction || currentOwner.isParameter) && | ||
!currentOwner.ownersIterator.exists(s => s.isDeprecated || s.companionClass.isDeprecated)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition for isSynthetic
is unfortunately tweaky. Is there a better way to ask, Did the user introduce this symbol? I might have guessed isArtifact
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using isSynthetic
and then trying to get back warnings that should show up, could we do something more specific for case classes?
I'm pushing an attempt, let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is narrowly focused to address that issue. There is no reason to over-generalize.
although I hit approve, probably @lrytz should have a look too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I was going to nowarn that code as Seth requested, sorry to make work for you.
Also tweak the spec. I'll do that in a separate PR so this can be merged with due speed.
Oh, I can't "approve", only "comment" that I approve the additional commits.
"I'm the PR author, and I approve these commits."
Revert adding deprecation to companion. Instead, check companions for deprecation in refchecks.
36e5912
to
e0dcca4
Compare
Thanks! |
Reverts the ancient fix for scala/bug#2799 at 95d7ef4
Surprised to see nothing broke. It would be nice to know why and apply that fairydust to Dotty. (Edit: actually, I mentioned
scala.io.Position
on the dotty ticket.)Instead of juggling annotations, the deprecation loophole is expanded to look more like the tax code.