langtools/test/tools/javac/annotations/typeAnnotations/failures/BadCast.java
changeset 21041 99f5e5e97425
parent 15385 ee1eebe7e210
equal deleted inserted replaced
21040:3e32f68d2151 21041:99f5e5e97425
     3  * @bug 8006775
     3  * @bug 8006775
     4  * @summary A cast cannot consist of only an annotation.
     4  * @summary A cast cannot consist of only an annotation.
     5  * @author Werner Dietl
     5  * @author Werner Dietl
     6  * @compile/fail/ref=BadCast.out -XDrawDiagnostics BadCast.java
     6  * @compile/fail/ref=BadCast.out -XDrawDiagnostics BadCast.java
     7  */
     7  */
       
     8 import java.lang.annotation.*;
       
     9 
     8 class BadCast {
    10 class BadCast {
     9   static void main() {
    11   static void main() {
    10     Object o = (@A) "";
    12     Object o = (@A) "";
    11   }
    13   }
    12 }
    14 }
    13 
    15 
       
    16 @Target(ElementType.TYPE_USE)
    14 @interface A { }
    17 @interface A { }