Community
Participate
Working Groups
M20050727-1200 class Top<E> { } class Sub<S> extends Top<S> { } Take the generic type binding of the declaration Sub<S> and ask it isSubTypeCompatible(the generic type binding of the declaration Top<E>) is: false expected: true Works e.g. for class Raw extends Top { }
According to http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#4.10, "Subtyping does not extend through generic types: T <: U does not imply that C<T> <: C<U>.". So in this case, we behave as spec'ed.