test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.java

Tue, 14 May 2013 15:04:06 -0700

author
jjg
date
Tue, 14 May 2013 15:04:06 -0700
changeset 1755
ddb4a2bfcd82
child 2210
a746587a1ff1
permissions
-rw-r--r--

8013852: update reference impl for type-annotations
Reviewed-by: jjg
Contributed-by: wdietl@gmail.com, steve.sides@oracle.com, joel.franck@oracle.com, alex.buckley@oracle.com

     1 /*
     2  * @test /nodynamiccopyright/
     3  * @bug 1234567
     4  * @summary ensure that declaration annotations are not allowed on
     5  *   new array expressions
     6  * @author Werner Dietl
     7  * @compile/fail/ref=DeclarationAnnotation.out -XDrawDiagnostics DeclarationAnnotation.java
     8  */
     9 class DeclarationAnnotation {
    10     Object e1 = new @DA int[5];
    11     Object e2 = new @DA String[42];
    12     Object e3 = new @DA Object();
    14     // The declaration annotation is only allowed for
    15     // an anonymous class creation.
    16     Object ok = new @DA Object() { };
    17 }
    19 @interface DA { }

mercurial