There is a bug with most specific and default methods when two signatures are merged from a interface as a result of generic specialization:
class Test {
public void testMergeAbstract(DA<String> da) {
da.m("");
}
public void testMergeInterface(DI<String> di) {
di.m("");
}
abstract class DA<T> {
abstract int m(T arg);
int m(String arg) { return 42; }
}
interface DI<T> {
int m(T arg);
default int m(String arg) { return 42; }
}
}
This gives:
Test.java:234: error: reference to m is ambiguous
di.m("");
^
both method m(T) in DI and method m(String) in DI match
where T is a type-variable:
T extends Object declared in interface DI
1 error
Note that the dual case with abstract classes work just fine.