langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedClassExpr.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * @test /nodynamiccopyright/ |
2 * @test /nodynamiccopyright/ |
3 * @bug 8027262 |
3 * @bug 8027262 8027888 |
4 * @summary A class expression cannot be annotated. |
4 * @summary A class expression cannot be annotated. |
5 * @compile/fail/ref=AnnotatedClassExpr.out -XDrawDiagnostics AnnotatedClassExpr.java |
5 * @compile/fail/ref=AnnotatedClassExpr.out -XDrawDiagnostics AnnotatedClassExpr.java |
6 */ |
6 */ |
7 import java.lang.annotation.*; |
7 import java.lang.annotation.*; |
8 import java.util.List; |
8 import java.util.List; |
9 |
9 |
10 class AnnotatedClassExpr { |
10 class AnnotatedClassExpr { |
11 static void main() { |
11 static void main() { |
12 Object o1 = @A int.class; |
12 Object o1 = @A int.class; |
|
13 o1 = @A int [] . class; |
|
14 o1 = int @A [] . class; |
|
15 o1 = int [] @A [] . class; |
|
16 o1 = AnnotatedClassExpr @A [] .class; |
|
17 o1 = @A AnnotatedClassExpr @A [] .class; |
|
18 o1 = @A AnnotatedClassExpr.class; |
13 } |
19 } |
14 } |
20 } |
15 |
21 |
16 @Target(ElementType.TYPE_USE) |
22 @Target(ElementType.TYPE_USE) |
17 @interface A { } |
23 @interface A { } |