[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:
@@ -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");
|
||||
|
||||
Generated
+5
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user