K2: Refine handling of Delegate resolution mode
- Move it out of the ContextDependent hierarchy
- Get rid of many controversial checks that were necessary because
Delegate was a ContextDependent inheritor
- Actually fix semantics for lambda processing
Previously, lambdas as delegate expression were not being analyzed
thus leading to an exception (see KT-64635), and this change
forces analyzing them in the same mode as ContextIndependent
(thus `{}` made by default `() -> Unit` leaving to DELEGATE_SPECIAL_FUNCTION_MISSING)
Before this change, new test was failing with an exception.
I've analyzed all `is ContextDependent` and it seems that none of them
is relevant to delegates.
^KT-64635 Fixed
This commit is contained in:
committed by
Space Team
parent
47a51f6499
commit
df2a1d4d02
+6
@@ -10687,6 +10687,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
runTest("compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaDelegate.kt")
|
||||
public void testLambdaDelegate() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/delegatedProperty/inference/lambdaDelegate.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaWithMultipleReturns.kt")
|
||||
public void testLambdaWithMultipleReturns() throws Exception {
|
||||
|
||||
+6
@@ -10687,6 +10687,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
runTest("compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaDelegate.kt")
|
||||
public void testLambdaDelegate() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/delegatedProperty/inference/lambdaDelegate.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaWithMultipleReturns.kt")
|
||||
public void testLambdaWithMultipleReturns() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user