Skip to content

Also deprecate backing field symbols.#8122

Merged
SethTisue merged 1 commit intoscala:2.12.xfrom
hrhino:t11538
Jun 18, 2019
Merged

Also deprecate backing field symbols.#8122
SethTisue merged 1 commit intoscala:2.12.xfrom
hrhino:t11538

Conversation

@hrhino
Copy link
Contributor

@hrhino hrhino commented 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.

Fixes scala/bug#11538 in an expedient manner.

I hope this works.

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.

Fixes scala/bug#11538 in an expedient manner.
@hrhino hrhino requested a review from som-snytt June 5, 2019 11:04
@scala-jenkins scala-jenkins added this to the 2.12.9 milestone Jun 5, 2019
@hrhino
Copy link
Contributor Author

hrhino commented Jun 5, 2019

Thanks @dwijnand. I accidentally pushed to the wrong repo and had to recreate it, and you know how airports and rushing around make it hard to pay attention to details.

Copy link
Contributor

@som-snytt som-snytt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that convenient. Thanks!

@hrhino
Copy link
Contributor Author

hrhino commented Jun 5, 2019

It's my first one-liner in a while, which gives me fear that it isn't the right solution. If it breaks, though, it'll only break 2.12.9, not 2.13.0, thereby encouraging people to migrate.

@som-snytt
Copy link
Contributor

Excellent! Always thinking ahead! Or behind, in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants