You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The annotation isn't winding up on the field. (Same issue with val.)
I looked at how it's done and went blind. Annotations from trees have to be attached to symbols. Possibly they are rethinking the mechanism #10459 I ran out of morning coffee before I saw why getters and setters work but not the field sym.
hrhino
added a commit
to scala/scala
that referenced
this issue
Jun 5, 2019
Compiling
@deprecated val foo: T = some.deprecated(call)
yielded
private[this] val `foo `: T = some.deprecated(call)
@deprecated <accessor> def foo: T = this.`foo `
where the `@deprecated` has been slapped on the def (where it'll incur
deprecation warnings on callers) but not on the val (where it'll
suppress deprecation warnings on the body.
Just copy the annotation across.
Fixesscala/bug#11538 in an expedient manner.
Scalac report a warning on
@deprecated(...) var
if its type contains deprecated type.However, inconsitently, scalac does not report a warning on
@deprecated(...) def
that uses deprecated type.For me working on scala-js/scala-js-dom#367, no warnings on member already marked as
@deprecated
is preferrable.But it may depends on use case.
cc: @sjrd scala-js/scala-js-dom#367 (comment)
The text was updated successfully, but these errors were encountered: