Community
Participate
Working Groups
The following class compiles in javac, and in Eclipse 3.1M7, but now fails to compile in RC1 with the error message "Bound mismatch: The generic method a() of type Foo<T> is not applicable for the arguments () since the type ? extends T is not a valid substitute for the bounded parameter <U extends T>" It certainly appears to be type-safe, though I haven't read the spec to be positive. public class Foo<T> { B<? extends T> b() { return a(); } <U extends T> B<U> a() { return null; } static class B<X> { } }
It indeed feels like we are a bit too strict.
New capture oriented bound check is not properly handling cases where upperbound is a type variable. Added GenericTypeTest#test707. Fixed
Verified for 3.1 RC2 using build N20050607-0010 + JDT/Core HEAD
Verified for 3.1 RC2 using build I20050610-0010