Use the same temporary trace for analyzing all candidate calls

Otherwise, when completing all the unsuccessfull candiates,
resolution of each lambda-arguments starts repeatedly for each candidate
that leads to exponential time

NB: Changes in `completeArguments` are necessary because otherwise
nested lambdas will be analyzed twice:
once for the main resolved call, and then for all candidates
that again leads to exponential complexity

 #KT-16672 Fixed
 #KT-19457 Fixed
This commit is contained in:
Denis Zharkov
2017-08-30 12:51:29 +03:00
parent 84c2e01161
commit d6fbb084b1
7 changed files with 182 additions and 5 deletions
@@ -18123,6 +18123,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("manyInapplicableCandidatesWithLambdas.kt")
public void testManyInapplicableCandidatesWithLambdas() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/resolve/nestedCalls/manyInapplicableCandidatesWithLambdas.kt");
doTest(fileName);
}
@TestMetadata("twoTypeParameters.kt")
public void testTwoTypeParameters() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/resolve/nestedCalls/twoTypeParameters.kt");
@@ -78,6 +78,12 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
doTest(fileName);
}
@TestMetadata("hugeUnresolvedKotlinxHtml.kt")
public void testHugeUnresolvedKotlinxHtml() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/hugeUnresolvedKotlinxHtml.kt");
doTest(fileName);
}
@TestMetadata("ifElseJavaList.kt")
public void testIfElseJavaList() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/ifElseJavaList.kt");