[FIR] Fix incorrect updating of callable reference type in delegated property

... if the delegate happens to be a function call whose second
argument is a callable reference but not actually a provideDelegate
call.
The fix is to ensure that the call is _actually_ a desugared
provideDelegate call.

This fixes a CCE in a case where the delegate expression is a regular
function call and the second argument is a callable reference.

#KT-65165 Fixed
This commit is contained in:
Kirill Rakhman
2024-01-30 17:49:06 +01:00
committed by Space Team
parent fced126c9f
commit 853ad54699
22 changed files with 150 additions and 1 deletions
@@ -13005,6 +13005,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/delegatedProperty/beforeDeclarationContainerOptimization.kt");
}
@TestMetadata("callableReferenceAsSecondArgumentOfDelegate.kt")
public void testCallableReferenceAsSecondArgumentOfDelegate() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/callableReferenceAsSecondArgumentOfDelegate.kt");
}
@TestMetadata("capturePropertyInClosure.kt")
public void testCapturePropertyInClosure() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/capturePropertyInClosure.kt");