mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
Revert: overload resolution: don't prefer concrete over abstract if the signatures are not override-equivalent (2bedb80d81)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
@@ -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>
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user