-
Bug
-
Resolution: Fixed
-
P3
-
5.0, 7
-
b40
-
generic
-
generic, solaris_8
-
Not verified
An Eclipse developer observed that javac detects an error in the program below, but the Eclipse compiler does not.
interface J {
String foo(Number n);
}
interface K {
Object foo(Number n);
}
public abstract class X implements J, K {
void foo() {
foo(0.0f); // javac error: ambiguous
}
}
class Z extends X {
public String foo(Number f) {
return null;
}
public static void main(String args[]) {
System.out.println(new Z().foo(0.0f));
}
}
interface J {
String foo(Number n);
}
interface K {
Object foo(Number n);
}
public abstract class X implements J, K {
void foo() {
foo(0.0f); // javac error: ambiguous
}
}
class Z extends X {
public String foo(Number f) {
return null;
}
public static void main(String args[]) {
System.out.println(new Z().foo(0.0f));
}
}
- duplicates
-
JDK-6198767 Unambiguous method calls flagged as ambiguous
- Closed
- relates to
-
JDK-4907941 missing ambiguity error
- Resolved
-
JDK-6400189 raw types and inference
- Closed
-
JDK-6748088 Abstract classes and interfaces should inherit override-equivalent methods similarly
- Closed