1/*
2 * @test /nodynamiccopyright/
3 * @bug 8013852
4 * @summary ensure that declaration annotations are not allowed on
5 *   method receiver types
6 * @author Werner Dietl
7 * @compile/fail/ref=DeclarationAnnotation.out -XDrawDiagnostics DeclarationAnnotation.java
8 */
9
10import java.lang.annotation.ElementType;
11import java.lang.annotation.Target;
12
13class DeclarationAnnotation {
14    void bad(@DA DeclarationAnnotation this) {}
15    void good(@TA DeclarationAnnotation this) {}
16}
17
18@interface DA { }
19
20@Target(ElementType.TYPE_USE)
21@interface TA { }
22