K2: Fix IAE at Candidate.updateSourcesOfReceivers inside PCLA lambda
Previously, it was failing at line (resolvedReceiver?.toReference(session) as? FirNamedReferenceWithCandidate)?.candidate?.updateSourcesOfReceivers() But this line was mostly incorrect because in case of `a.b()` call, which is resolved to `a.b.invoke()`, `resolvedReceiver` is pointing to `a` instead of obviously expected `a.b`. The fix with using `candidate.callInfo.explicitReceiver` doesn't help either because the candidate of that receiver is always completed at that stage (so no Candidate there). The only case when the candidate was still there is PCLA because in that case we explicitly don't fully complete even receiver expressions. (see docs/fir/pcla.md) The idea of the fix is moving the call of `updateSourcesOfReceivers` for invoke property receiver to the place just before the candidate is being converted to the resolved reference (i.e., the candidate is being lost) ^KT-66148 Fixed
This commit is contained in:
committed by
Space Team
parent
ae9c9b051f
commit
b7129f78a3
+5
@@ -3078,6 +3078,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/builderInference/posptonedPCLACallInsideStringInterpolation.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertyInvokeInsidePCLALambda.kt")
|
||||
public void testPropertyInvokeInsidePCLALambda() {
|
||||
runTest("compiler/testData/codegen/box/builderInference/propertyInvokeInsidePCLALambda.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt")
|
||||
public void testReceiverUsesOuterTVButReturnTypeIsProper() {
|
||||
runTest("compiler/testData/codegen/box/builderInference/receiverUsesOuterTVButReturnTypeIsProper.kt");
|
||||
|
||||
Reference in New Issue
Block a user