Community
Participate
Working Groups
The following code compiles with Eclipse: ------------------------------------------------ public class Sample { public interface Foo {} public interface Bar {} public <T extends Foo&Bar> void xxx(T t){} public <T extends Bar&Foo> void xxx(T t){} } ------------------------------------------------ Whereas it fails with javac 1.8.0_51: ------------------------------------------------ Sample.java:8: error: method <T>xxx(T) is already defined in class Sample public <T extends Bar&Foo> void xxx(T t){} ^ where T is a type-variable: T extends Foo,Bar declared in method <T>xxx(T) 1 error ------------------------------------------------ and, it fails with Eclipse: ------------------------------------------------ public class SampleEx extends Sample{ @Override public <T extends Foo & Bar> void xxx(T t) {} @Override public <T extends Bar & Foo> void xxx(T t) {} } ------------------------------------------------ Name clash: The method xxx(T) of type SampleEx has the same erasure as xxx(T) of type Sample but does not override it The method xxx(T) of type SampleEx must override or implement a supertype method
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
Comment 0 still holds, but I don't have the time to check JLS, which compiler is right and by which rule. Everyone affected is invited to demonstrate that ecj deviates from JLS and how so. I am, e.g., not aware of any rule defining equivalence of type parameters or intersection types (bounds). Note, that in the .class file both methods differ indeed, since one parameter is erased to Foo and the other to Bar.