Community
Participate
Working Groups
Reproduced with Eclipse SDK 3.3 M6 build. JDT compiler is producing an ambiguous method call error in code with Java 5.0 generic methods that the Sun javac compiler compiles without incident. Rather than attempt to describe the test case, I will attach a tiny project that demonstrates the problem.
Created attachment 66696 [details] Small test project Attached a small test project demonstrating the problem. The PartTimeEmpoyee class's implementation of the respond(...) method shows an ambiguous method call error on the call to super, which has the identical signature. The superclass's (Employee) own delegation to its superclass's implementation (Person) does not report this error.
Philippe - please review the patch. This code comes from the verifier when it validates a substite.
Created attachment 67125 [details] Proposed patch
Patch is good providing changing the signature of TypeVariableBinding#isInterchangeableWith(...) to take a Substitution as 2nd argument (instead of ParameterizedGenericMethodBinding).
Updated signature of TypeVariableBinding#isInterchangeableWith(...) Released into HEAD for 3.3RC1
Verified for 3.3 RC1 using build I20070516-0010
Created attachment 68100 [details] Example project (2 java files, .project, .classpath)
I'm still seeing this bug, or something very similar to it. The uploaded zip file contains example code to demonstrate it. The code compiles under Sun's javac (Java 1.5.0_10) but not in Eclipse 3.3RC1, build I20070517-1700 MyList extends ArrayList and declares a method "void add(Comparable o)". TestClass then calls add(o) on an instance of MyList and eclipse complains that the method add(Comparable) is ambiguous for the type MyList.
Toby - your case is not related to this one. I've entered bug 188741 for your case.
Thanks for the quick fix under 188741, and apologies that it wasn't related - I'm always wary of creating duplicates, perhaps too much so!