Community
Participate
Working Groups
I20070608-1718 The following test case yields an ambiguous method error with JDT, while neither javac 1.5.0_12 nor javac 6_02 complain. public class X { enum A implements B { X; } interface B { } interface Spec { <T extends Enum<T> & B> void method(T t); } static abstract class TestAbstract implements Spec { public <T extends Enum<T> & B> void method(T t) { } public void test() { method(A.X); // ambiguous by JDT, but not javac } } static class TestConcrete implements Spec { public <T extends Enum<T> & B> void method(T t) { } public void test() { method(A.X); } } }
This is a strange case. We do not report a problem with this : enum E implements I { F; } interface I {} interface Spec { <T extends Enum<T> & I> void method(T t); } //abstract class X implements Spec { class X implements Spec { public <T extends Enum<T> & I> void method(T t) {} void test() { method(E.F); } } But we do report an incorrect ambiguous error when X is abstract.
Added AmbiguousMethodTest 62 Released into HEAD for 3.4 M2 Released for 3.3.1
+1 for 3.3.1
The regression test leverages the scenario of comment 1, not the original test case provided. The former might well be a true proxy for the latter (at least the same fix addresses both situations), but since this is not that obvious when reading both, you may consider adding a regression test for the original test case. Anyway, Verified for 3.3.1 using build M20070831-2000.
Verified for 3.4 using I20070917-0010