8293519: deprecation warnings should be emitted for uses of annotation methods inside other annotations
Reviewed-by: jlahoda
This commit is contained in:
parent
4bef233a4a
commit
6beadbbe9f
@ -521,6 +521,7 @@ public class Annotate {
|
||||
left.name, List.nil(), null);
|
||||
left.sym = method;
|
||||
left.type = method.type;
|
||||
chk.checkDeprecated(left, env.info.scope.owner, method);
|
||||
if (method.owner != thisAnnotationType.tsym && !badAnnotation)
|
||||
log.error(left.pos(), Errors.NoAnnotationMember(left.name, thisAnnotationType));
|
||||
Type resultType = method.type.getReturnType();
|
||||
|
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8293519
|
||||
* @summary deprecation warnings should be emitted for uses of annotation methods inside other annotations
|
||||
* @compile/fail/ref=DeprecationWarningTest.out -deprecation -Werror -XDrawDiagnostics DeprecationWarningTest.java
|
||||
*/
|
||||
|
||||
// both classes can't be inside the same outermost class or the compiler wont emit the warning as `9.6.4.6 @Deprecated` mandates
|
||||
@interface Anno {
|
||||
@Deprecated
|
||||
boolean b() default false;
|
||||
}
|
||||
|
||||
@Anno(b = true)
|
||||
class Foo {}
|
@ -0,0 +1,4 @@
|
||||
DeprecationWarningTest.java:14:7: compiler.warn.has.been.deprecated: b(), Anno
|
||||
- compiler.err.warnings.and.werror
|
||||
1 error
|
||||
1 warning
|
Loading…
Reference in New Issue
Block a user