test/tools/javac/annotations/repeatingAnnotations/WrongReturnTypeForValue.java

changeset 1492
df694c775e8a
parent 1386
bf76f4190ef8
child 2525
2eb010b6cb22
equal deleted inserted replaced
1491:9f42a06a49c0 1492:df694c775e8a
4 * @author sogoel 4 * @author sogoel
5 * @summary Wrong return type for value() in ContainerAnnotation 5 * @summary Wrong return type for value() in ContainerAnnotation
6 * @compile/fail/ref=WrongReturnTypeForValue.out -XDrawDiagnostics WrongReturnTypeForValue.java 6 * @compile/fail/ref=WrongReturnTypeForValue.out -XDrawDiagnostics WrongReturnTypeForValue.java
7 */ 7 */
8 8
9 import java.lang.annotation.ContainedBy; 9 import java.lang.annotation.Repeatable;
10 import java.lang.annotation.ContainerFor;
11 10
12 @ContainedBy(FooContainer.class) 11 @Repeatable(FooContainer.class)
13 @interface Foo { 12 @interface Foo {
14 int getNumbers(); 13 int getNumbers();
15 } 14 }
16 15
17 @ContainerFor(Foo.class)
18 @interface FooContainer{ 16 @interface FooContainer{
19 Foo value(); // wrong return type 17 Foo value(); // wrong return type
20 } 18 }
21 19
22 @Foo @Foo 20 @Foo @Foo

mercurial