langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.java
author jjg
Fri, 02 May 2014 16:41:10 -0700
changeset 24292 12414a72f8d2
parent 22003 ed437c411fbd
child 24895 dd091d389fbf
permissions -rw-r--r--
8042358: some tests have placeholder bugid 1234567 Reviewed-by: mduigou

/*
 * @test /nodynamiccopyright/
 * @bug 8013852
 * @summary ensure that declaration annotations are not allowed on
 *   new array expressions
 * @author Werner Dietl
 * @compile/fail/ref=DeclarationAnnotation.out -XDrawDiagnostics DeclarationAnnotation.java
 */
class DeclarationAnnotation {
    Object e1 = new @DA int[5];
    Object e2 = new @DA String[42];
    Object e3 = new @DA Object();
    Object ok = new @DA Object() { };
}

@interface DA { }