| Summary: | [1.8][compiler] No error shown for ambiguous reference to the method | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Noopur Gupta <noopur_gupta> |
| Component: | Core | Assignee: | Srikanth Sankaran <srikanth_sankaran> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | daniel_megert, jarthana, markus.kell.r, srikanth_sankaran, stephan.herrmann |
| Version: | 4.4 | ||
| Target Milestone: | BETA J8 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
There are no method references in the program :) I think this is a duplicate of https://bugs.eclipse.org/bugs/show_bug.cgi?id=422731 So you can work on G related issues without distraction, I'll take over this one. (Disabled) test released here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=a17a9082800c426c4984b5ef76877aab1c8e09e6 (In reply to Srikanth Sankaran from comment #3) > (Disabled) test released here: > http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/ > ?h=BETA_JAVA8&id=a17a9082800c426c4984b5ef76877aab1c8e09e6 That was meant for some other bug. Fix and tests released here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=efd527bb42c9215375b4d1cf91326767eee94a32 This is a McWhopper of a bug, thanks for catching it ! *** Bug 422731 has been marked as a duplicate of this bug. *** I initially thought the following was same as the one reported here, but not entirely sure:
class C2 {
{
bar( () -> (char) 0); // [1]
}
void bar(FC fc) { }
void bar(FB fb) { }
}
interface FB {
byte foo();
}
interface FC {
char foo();
}
This one is accepted by ECJ while Javac rejects.
For issues of method ambiguity involving lambdas also see bug 423505 (In reply to Jayaprakash Arthanareeswaran from comment #6) > I initially thought the following was same as the one reported here, but not > entirely sure: Good catch ! This is a different problem, a good one to fix. I have raised: https://bugs.eclipse.org/bugs/show_bug.cgi?id=425712 |
package test; class C2 implements C2_Sup { public static final FI fi = x -> x++; public static final FL fl = x -> x++; { bar(x -> x++); // [1] bar(fl); } void bar(FI fi) { } } interface C2_Sup { default void bar(FL fl) { } } @FunctionalInterface interface FI { int foo(int x); } @FunctionalInterface interface FL { long foo(long x); } -------------------------------------------------------- The above example compiles without any error with ECJ, but shows error at [1] with b118.