-
Bug
-
Resolution: Fixed
-
P4
-
1.1, 1.1.5
-
1.2fcs
-
x86
-
windows_95, windows_nt
-
Not verified
Name: mc57594 Date: 02/07/97
if the primary expression of a method invocation has interface
type, and that interface inherits two methods with the same signature, the
compiler reports an ambiguity if f() is called through the derived
interface, even though the signatures are identical and so should be
treated as one entity for the purposes of overload resolution. (Guy Steele
has confirmed this interpretation of the JLS.)
Sample code:
interface A {
void f ();
}
interface B {
void f ();
}
interface C extends A, B {
}
class D {
void g (C c) {
c.f(); // this should not be ambiguous
}
}
Note that if C is an abstract class not an interface the code compiles
correctly.
======================================================================
allan.jacobs@Eng 1997-11-24
Added a bug to "See also...." Changing the Description to get around
a Bugtraq bug.
Nope. Didn't work. The shadow for this bug is 4094971.
- duplicates
-
JDK-4033865 Identical signatures cause ambiguity during overload resolution
- Closed
-
JDK-4107476 Interface extension gets confused by duplicate methods
- Closed