AnnotatedClassExpr.java revision 2789:014b653eafa9
172878Skris/* 272878Skris * @test /nodynamiccopyright/ 3100772Sjhb * @bug 8027262 8027888 4100772Sjhb * @summary A class expression cannot be annotated. 5100772Sjhb * @compile/fail/ref=AnnotatedClassExpr.out -XDrawDiagnostics AnnotatedClassExpr.java 672878Skris */ 7101232Sruimport java.lang.annotation.*; 8100773Sjhbimport java.util.List; 9125252Sjhb 10113374Sobrienclass AnnotatedClassExpr { 11100773Sjhb static void main() { 12100772Sjhb Object o1 = @A int.class; 13103560Sjhb o1 = @A int [] . class; 14126657Sbde o1 = int @A [] . class; 15115175Speter o1 = int [] @A [] . class; 16100773Sjhb o1 = AnnotatedClassExpr @A [] .class; 17100772Sjhb o1 = @A AnnotatedClassExpr @A [] .class; 18103560Sjhb o1 = @A AnnotatedClassExpr.class; 19100773Sjhb } 20100772Sjhb} 21129217Scognet 22129217Scognet@Target(ElementType.TYPE_USE) 23129217Scognet@interface A { } 24100773Sjhb