Community
Participate
Working Groups
Build ID: I20090605-1444 Steps To Reproduce: 1. Create compilation unit with provided content 2. Error should appear in B.method2() at line 26 More information: In earlier version of Eclipse (3.4.2) compiler reported only wanrnings at given line: * Type safety: The expression of type X.B needs unchecked conversion to conform to X.B<V> * Type safety: Unchecked invocation get(Class<V>, Class<X.B>) of the generic method get(Class<V>, Class<S>) of type X.L In Eclipse 3.5RC4 this warning changed to error: * Type mismatch: cannot convert from X.A to X.B<V> I'm not exactly sure which behavior is correct, but I strongly believe that the error report is wrong because return type of B.get may be determined by method arguments. Such belief is supported by earlier version of JDT and also by Sun JDK 1.6.0_14 javac compiler which also reports only wanings. Source code: public class X { static class A<V> { L l; public Class<V> vtype() { return null; } public A<V> method1() { return l.get(vtype(), B.class); } } static class L { public <V,S extends A<V>> S get(Class<V> vtype, Class<S> stype) { return null; } } static class B<V> extends A<V> { public B<V> method2() { return l.get(vtype(), B.class); } } }
*** This bug has been marked as a duplicate of bug 277643 ***
Verified using I20090609-1400.
OK