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