Tue, 15 Oct 2013 15:57:13 -0700
8026564: import changes from type-annotations forest
Reviewed-by: jjg
Contributed-by: wdietl@gmail.com, steve.sides@oracle.com
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 */
9 import java.lang.annotation.*;
10 import java.util.List;
12 class CantAnnotatePackages {
13 // Before a package component:
14 @TA java.lang.Object of1;
16 // These result in a different error.
17 // TODO: should this be unified?
19 List<@TA java.lang.Object> of2;
20 java. @TA lang.Object of3;
21 List<java. @TA lang.Object> of4;
23 // TODO: also note the order of error messages.
24 }
26 @Target(ElementType.TYPE_USE)
27 @interface TA { }