Community
Participate
Working Groups
When the following code is compiled with Eclipse, it succeeds, but javac displays the following error: interface Templated { public <K extends List<Integer> & Map<Float, Float>> K func(); } Error: types java.util.Map<java.lang.Float,java.lang.Float> and java.util.List<java.lang.Integer> are incompatible; both define remove(java.lang.Object), but with unrelated return types
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.
Thanks, can reproduce. Apparently we check well formedness of type variable bounds only for class type variables and not for generic method's type variables. This program generates an error at the declaration of T: import java.util.List; import java.util.Map; interface Templated<T extends List<Integer> & Map<Float, Float>> { public <K extends List<Integer> & Map<Float, Float>> K func(); } Description Resource Path Location Type The return types are incompatible for the inherited methods Collection<Integer>.remove(Object), List<Integer>.remove(Object), Map<Float,Float>.remove(Object) test.java /_pasted_code_/src line 4 Java Problem