Skip to content

@Deprecated(forRemoval=true) still propagates to members when consumed from binary #4580

@stephan-herrmann

Description

@stephan-herrmann

I observed the annoying situation of a necessary @SuppressWarnings token reported as unnecessary (choose your warning).

It turned out that I forgot to remove BinaryTypeBinding.markImplicitTerminalDeprecation(ReferenceBinding) so this ...

@Deprecated(forRemoval=true) public class Dep {
    @Deprecated public static final String S;
}
@SuppressWarnings({"removal", "deprecation"})
class DepSub extends Dep {
    @Deprecated public static final String S = Dep.S;
}

... would lead to trouble when Dep is read from .class file: now Dep.S would have both bits, AnnotationDeprecated, and AnnotationTerminallyDeprecated leading to more confusion down the river.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions