Revert: overload resolution: don't prefer concrete over abstract if the signatures are not override-equivalent (2bedb80d81)

This commit is contained in:
Anna Kozlova
2016-05-31 11:42:55 +03:00
parent 86aa72abe4
commit 99fe682d0b
5 changed files with 16 additions and 57 deletions

View File

@@ -1,24 +0,0 @@
import java.io.IOException;
abstract class Ambiguity {
public abstract <T> T executeServerOperation(ThrowableComputable<T, IOException> computable);
public <T> T executeServerOperation(final Computable<T> computable) {
return null;
}
boolean foo(Ambiguity a, String s){
return a.<error descr="Ambiguous method call: both 'Ambiguity.executeServerOperation(ThrowableComputable<Boolean, IOException>)' and 'Ambiguity.executeServerOperation(Computable<Boolean>)' match">executeServerOperation</error>(() -> bool(s, a));
}
protected abstract boolean bool(String s, Ambiguity a);
}
interface ThrowableComputable<T, E extends Throwable> {
T compute() throws E;
}
interface Computable <T> {
T compute();
}

View File

@@ -39,7 +39,7 @@ class Test2 {
public static void main(IJ s, J<String> j) {
s.f("");
j.j<error descr="Ambiguous method call: both 'J.j(String)' and 'J.j(String)' match">("")</error>;
<error descr="Static method may be invoked on containing interface class only">j.j("");</error>
}
}