1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.java Wed Apr 27 01:34:52 2016 +0800 1.3 @@ -0,0 +1,16 @@ 1.4 +/* 1.5 + * @test /nodynamiccopyright/ 1.6 + * @bug 1234567 1.7 + * @summary ensure that declaration annotations are not allowed on 1.8 + * new array expressions 1.9 + * @author Werner Dietl 1.10 + * @compile/fail/ref=DeclarationAnnotation.out -XDrawDiagnostics DeclarationAnnotation.java 1.11 + */ 1.12 +class DeclarationAnnotation { 1.13 + Object e1 = new @DA int[5]; 1.14 + Object e2 = new @DA String[42]; 1.15 + Object e3 = new @DA Object(); 1.16 + Object ok = new @DA Object() { }; 1.17 +} 1.18 + 1.19 +@interface DA { }