Community
Participate
Working Groups
AmbigousMethodTest#test051 (and test053, and test074) test051 reproduced below: interface I<T> { } class Y { void bar(I<?> x) { } } public class X extends Y { void foo() { bar(new Z(){}); } void bar(Z x) { } private static class Z implements I { } } Specifically in 1.8; reports the error for <1.8
Exactly, these three tests show that our use of TB.isCompatibleWith is not strict enough in some situations. IIRC fine tuning TB.sIsMoreSpecific can restore the expected errors. The difficulty is only in finding the right implementation that does not cause (too many) regressions elsewhere. We need a strict test for subtyping to start with. From there it might be necessary to soften the tests for certain under-specified corner cases. One such grey zone appears to be the relations between types T#RAW and T<?>, another one the relation between T<?> and T<?>.
(In reply to Stephan Herrmann from comment #1) > Exactly, these three tests show that our use of TB.isCompatibleWith is not > strict enough in some situations. IIRC fine tuning TB.sIsMoreSpecific can > restore the expected errors. The difficulty is only in finding the right > implementation that does not cause (too many) regressions elsewhere. Stephan, may we should try a direct implementation of 4.10.1, 4.10.2 and 4.10.3.
GenericTypeTest#test1234 public class X { void a3(G x) {} <T extends F<X>> void a3(T x) {} public static void ambiguousCases() { H<X> hx = null; H hraw = null; new X().a3(hx);//javac reports ambiguous eclipse does not new X().a3(hraw);// javac reports ambiguous eclipse does not } } class F<T1> {} class G<T2> extends F<T2> {} class H<T3> extends G<T3> {}
Moving out of Mars
Moving out of 4.6 - target to be set later
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. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. 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.
this needs to be resolved
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.