|
1 /* |
|
2 * @test /nodynamiccopyright/ |
|
3 * @bug 1234567 |
|
4 * @summary The parts of a fully-qualified type can't be annotated. |
|
5 * @author Werner Dietl |
|
6 * @compile/fail/ref=CantAnnotatePackages.out -XDrawDiagnostics CantAnnotatePackages.java |
|
7 */ |
|
8 |
|
9 import java.lang.annotation.*; |
|
10 import java.util.List; |
|
11 |
|
12 class CantAnnotatePackages { |
|
13 // Before a package component: |
|
14 @TA java.lang.Object of1; |
|
15 |
|
16 // These result in a different error. |
|
17 // TODO: should this be unified? |
|
18 |
|
19 List<@TA java.lang.Object> of2; |
|
20 java. @TA lang.Object of3; |
|
21 List<java. @TA lang.Object> of4; |
|
22 |
|
23 // TODO: also note the order of error messages. |
|
24 } |
|
25 |
|
26 @Target(ElementType.TYPE_USE) |
|
27 @interface TA { } |