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:44:10 +03:00
parent 86aa72abe4
commit 99fe682d0b
5 changed files with 16 additions and 57 deletions
@@ -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>
}
}
@@ -17,7 +17,6 @@ package com.intellij.codeInsight.daemon;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.defUse.DefUseInspection;
import com.intellij.idea.Bombed;
import com.intellij.openapi.projectRoots.JavaSdkVersion;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.roots.LanguageLevelProjectExtension;
@@ -26,8 +25,6 @@ import com.intellij.testFramework.IdeaTestUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import java.util.Calendar;
/**
* This class intended for "heavily-loaded" tests only, e.g. those need to setup separate project directory structure to run.
* For "lightweight" tests please use {@linkplain LightAdvHighlightingJdk7Test}.
@@ -226,7 +223,6 @@ public class AdvHighlightingJdk7Test extends DaemonAnalyzerTestCase {
doTestAmbiguous();
}
@Bombed(day = 1, month = Calendar.JUNE, user = "anna")
public void testAmbiguousIDEA57569() throws Exception {
doTestAmbiguous();
}
@@ -229,10 +229,6 @@ public class OverloadResolutionTest extends LightDaemonAnalyzerTestCase {
doTest(false);
}
public void testNonComparableFunctionalInterfacesWithConcreteShouldNotWin() throws Exception {
doTest(false);
}
private void doTest() {
doTest(true);
}