-
Bug
-
Resolution: Fixed
-
P5
-
7
-
b21
-
generic
-
generic
The error message for incompatible inherited methods doesn't account for the possibility that both methods could come from the same class. The message could be improved:
InstanceClash.java:13: error: types Foo<String> and Foo<String> are incompatible; both define m(java.lang.String), but with unrelated return types
interface I extends Foo<String> {}
^
Here's the relevant source:
public static interface Foo<S> {
String m(String s);
int m(S o);
}
interface I extends Foo<String> {}
InstanceClash.java:13: error: types Foo<String> and Foo<String> are incompatible; both define m(java.lang.String), but with unrelated return types
interface I extends Foo<String> {}
^
Here's the relevant source:
public static interface Foo<S> {
String m(String s);
int m(S o);
}
interface I extends Foo<String> {}