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.
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.
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.
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 |
som-snytt
left a comment
There was a problem hiding this comment.
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.Positionon the dotty ticket.)Instead of juggling annotations, the deprecation loophole is expanded to look more like the tax code.