Summary: | [1.5] Ambiguous method error with overloaded parameterized methods | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | kent_johnson |
Version: | 3.0 | ||
Target Milestone: | 3.1 M4 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Markus Keller
2004-09-15 05:58:21 EDT
Philippe - This is a bug in ParameterizedGenericMethodBinding computeCompatibleMethod() When the message send is m(new B()) and we substitute for the method: <E extends A> void m(E e) we create a ParameterizedGenericMethodBinding: m(B) instead of: m(A) So we get 2 ParameterizedGenericMethodBindings with B as their substituted parameter instead of one with A & one with B. Added MethodVerifyTest.test016() Type inference is not meant to substitute parameters with their bounds, but rather with type inferred from argument types. In this case, both (A)m(E) and (B)m(E) are substitutable into: m(B), which causes the ambiguity in the end. I suspect the tiebreak should use original methods rather than substituted ones, or at least have original bounds play. Tuned tiebreak. Added regression tests: GenericTypeTest#test425--426. Fixed Verified in 200412140800 |