don't calculate substitution for overload resolution applicability checks

This commit is contained in:
Anna Kozlova
2018-01-22 16:50:39 +03:00
parent ac4f817aa8
commit 04b7efb5cd
3 changed files with 19 additions and 0 deletions

View File

@@ -382,6 +382,9 @@ public class InferenceSession {
if (expectedActualErrorMessage != null && myErrorMessages != null) {
myErrorMessages.add(0, expectedActualErrorMessage);
}
if (isOverloadCheck()) {
return;
}
}
//proceed to B3 constraints
else if (parameters != null && args != null && !isOverloadCheck()) {

View File

@@ -0,0 +1,15 @@
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
class Foo {
public void foo(Set<String> types) { }
public void foo(Collection<Integer> types) { }
void m(final Stream<String> stringStream) {
foo(stringStream.collect(Collectors.toSet()));
}
}

View File

@@ -267,6 +267,7 @@ public class OverloadResolutionTest extends LightDaemonAnalyzerTestCase {
public void testUnqualifiedStaticInterfaceMethodCallsOnInnerClasses() { doTest(false);}
public void testStaticMethodInSuperInterfaceConflictWithCurrentStatic() { doTest(false);}
public void testOverloadsWithOneNonCompatible() { doTest(false);}
private void doTest() {
doTest(true);