Duplicate :
|
|
Relates :
|
|
Relates :
|
If base annotation is not meta-annotated with @Target, the compiler assumes that it has the JDK7 targets by default. If container annotation is now meta-annotated with @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) which are the new targets added in JDK8, the test code compiles unexpectedly. Expected behavior: TYPE_USE and TYPE_PARAMETER are not default targets, so target set for container annotation is not a subset of target set for base and compilation should fail. Test code attached.
|