Community
Participate
Working Groups
JDTCore v_501 The following declaration should be legal. public class X<E extends Enum<E>> { } however we reject it during its bound check: Bound mismatch: The type E is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type Enum<E>
Added regression test: GenericTypeTest#test271. Problem comes from the fact that while connecting hierarchy of E in X, its bound hasn't been set yet, and thus the bound check fails since E of Enum is expected to extend Enum<E>.
Simpler testcase: public class X<T extends XY<T>> { } class XY<U extends Cloneable> implements Cloneable { }
Fixed now that we delay the bounds checks til after all type variables are resolved AND force types referenced in bounds to be connected. See test271-273
Verified in I200409240100.