Spec says this is okay, but currently the type-annotations compiler does not accept it.
"A type annotation (one meta-annotated with @Target(ElementType.TYPE_USE)) is permitted to be written anywhere...@Target(ElementType.TYPE_PARAMETER) would permit — that is...on a type parameter declaration."
@Retention(RUNTIME)
@Target(ElementType.TYPE_USE)
@interface Uv {}
should be able to be used as
@Uv public class Test1 {
<@Uv T> String g(T t) { return null; } //gets error
}
"A type annotation (one meta-annotated with @Target(ElementType.TYPE_USE)) is permitted to be written anywhere...@Target(ElementType.TYPE_PARAMETER) would permit — that is...on a type parameter declaration."
@Retention(RUNTIME)
@Target(ElementType.TYPE_USE)
@interface Uv {}
should be able to be used as
@Uv public class Test1 {
<@Uv T> String g(T t) { return null; } //gets error
}