Consider this case:
class A {}
class B<T extends A, E extends T> {
B<?, A> b;
B<?, ? extends A> b2;
}
As I understand type bounds, in this case effective upper bounds of both T
and E
is class A
. So the question: why javac doesn't accept class A as argument in declaration of field b
, but accepts wildcard
? extends A
in declaration of field b2
?
Type parameter 'Test.A' is not within its bound; should extend '?'
. If it compiles for you, then it could potentially be a bug in Intellij. – Cooke