blob: aa991ebf2c68cc62aa13a2d8150d018a59b5f5af [file] [log] [blame]
/**
* @test /nodynamiccopyright/
* @bug 8044196
* @summary Make sure repeatable annotations can't be erroneously applied to type arguments.
* @compile/fail/ref=InvalidMethodTypeUse.out -XDrawDiagnostics InvalidMethodTypeUse.java
*/
import java.lang.annotation.*;
class InvalidMethodTypeUse {
@Target({ElementType.TYPE_USE, ElementType.METHOD, ElementType.TYPE_PARAMETER})
@Repeatable(TC.class)
@interface T { int value(); }
@Target({ElementType.METHOD, ElementType.TYPE_PARAMETER})
@interface TC { T[] value(); }
void method() {
this.<@T(1) @T(2) String>method2();
}
<@T(3) S> void method2() { }
}