Revert exclusion of companion for reporting deprecation#10311
Revert exclusion of companion for reporting deprecation#10311lrytz merged 1 commit intoscala:2.13.xfrom
Conversation
|
Why did I think Travis would let me "tweak" the spec? What hubris! |
4b207d0 to
f090f4a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
When the brain fog lifts, I'd like to take a moment to review whether expanding deprecation exemption via companion is a good idea. It came up on dotty for the same reason. Trying to minimize future reversions for @lrytz . |
f090f4a to
82ee122
Compare
82ee122 to
9098ff1
Compare
|
What PR does this revert? |
|
It's crossed out in the first comment. This doesn't revert the direct fix, but the expanded immunity to deprecation. |
|
Shouldn't the deprecation be copied over to the companion? diff --git a/src/library/scala/deprecated.scala b/src/library/scala/deprecated.scala
index 1459cd8192..25b7b54619 100644
--- a/src/library/scala/deprecated.scala
+++ b/src/library/scala/deprecated.scala
@@ -56,6 +56,6 @@ import scala.annotation.meta._
* @see [[scala.deprecatedOverriding]]
* @see [[scala.deprecatedName]]
*/
-@getter @setter @beanGetter @beanSetter @field
+@getter @setter @beanGetter @beanSetter @field @companionObject
@deprecatedInheritance("Scheduled for being final in the future", "2.13.0")
class deprecated(message: String = "", since: String = "") extends scala.annotation.ConstantAnnotation(except that |
|
@lrytz deprecating the companion is the previous/old behavior objected to on the related dotty ticket. (test neg/t2799.scala) |
|
OK, thanks. scala/scala3#12706 (comment) I was thinking to deprecate synthetic companions derived from deprecated classes, but then that doesn't work if the companion exists in source. Also, deprecating the module class (95d7ef40eb) instead of the module symbol was probably unintended magic :) |
as uncovered by recent merge of scala#10311
|
This did not revert the code comment. I need tooling that detects nearby code comments and verifies whether I intended to update the comments. |
Update spec for accommodation at #10071Instead of granting companions immunity from deprecation, make them explicitly choose whether to propagate the deprecation or explicitly
nowarn.Avoid trailing colon if message is empty. (Parity with fix in dotty.)