[NI] Complete calls during one inference session only once

The problem is that delegated properties resolve two calls together:
 `getValue`/`setValue` with a common receiver, which can contain
 callable references. For each completion new anonymous descriptor
 was created and caused "rewrite at slice" exceptions later.
 Now there is a little hack to check that during one inference session
 we don't complete one call more than one time.

 More correct fix would be to explicitly specify common receiver for
 inference session but it requires quite big refactoring, which will
 be done later with a whole refactoring of the common solver

 #KT-30250 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2019-03-04 17:24:27 +03:00
parent 14c93c7c0e
commit 7c357c0ec0
8 changed files with 67 additions and 4 deletions
@@ -5625,6 +5625,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/delegatedProperty/inference"), Pattern.compile("^(.*)\\.kts?$"), TargetBackend.ANY, true);
}
@TestMetadata("callableReferenceArgumentInDelegatedExpression.kt")
public void testCallableReferenceArgumentInDelegatedExpression() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/inference/callableReferenceArgumentInDelegatedExpression.kt");
}
@TestMetadata("delegateExpressionAsLambda.kt")
public void testDelegateExpressionAsLambda() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/inference/delegateExpressionAsLambda.kt");
@@ -5620,6 +5620,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/delegatedProperty/inference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("callableReferenceArgumentInDelegatedExpression.kt")
public void testCallableReferenceArgumentInDelegatedExpression() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/inference/callableReferenceArgumentInDelegatedExpression.kt");
}
@TestMetadata("delegateExpressionAsLambda.kt")
public void testDelegateExpressionAsLambda() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/inference/delegateExpressionAsLambda.kt");