Fix "Rewrite at slice LEXICAL_SCOPE" for callable references
For special calls (when-expressions, if-expressions, etc.), do not attempt to get type of the argument expression, which is the block with the callable reference, instead get type of the callable reference itself. The difference matters because for block expressions, a new lexical scope is created for each getTypeInfo (see ExpressionTypingServices.getBlockReturnedType), and we do not support rewrites of this value in the binding trace #KT-12044 Fixed
This commit is contained in:
@@ -2062,6 +2062,12 @@ public class LightAnalysisModeCodegenTestGenerated extends AbstractLightAnalysis
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt12044.kt")
|
||||
public void testKt12044() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/callableReference/property/kt12044.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt12982_protectedPropertyReference.kt")
|
||||
public void testKt12982_protectedPropertyReference() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/callableReference/property/kt12982_protectedPropertyReference.kt");
|
||||
|
||||
Reference in New Issue
Block a user