Summary: | [compiler][1.5] Correct use of generic interfaces give compiler error | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Thomas Barregren <thomas.barregren> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.1 | ||
Target Milestone: | 3.1 M5 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Thomas Barregren
2004-12-21 05:07:21 EST
Philippe: can you please take a look at this one? Here's the minimal testcase: interface I<T> { <S extends T> void doTest(S[] a); } abstract class AbstractTest<U> implements I<U> { public <V extends U> void doTest(V[] a) {} } class Test<M> extends AbstractTest<M> {} The problem is that when we attempt to do a bounds check with the method doTest, we fail when trying to verify the class Test. When AbstractTest asks, the variable T is correctly replaced with V, but when Test asks, M does not replace T so the type variable S thinks it is not compatible with M. Added support for cloning type variables, with substituted bounds when instantiating a parameterized method binding of a generic method. Added GenericTypeTest#test456. Fixed Verified in I20050214 |