K2: Fix internal error in FIR2IR caused by PCLA + String interpolation
There's an implicit contract in PCLA that the statement-level call should be postponed iff it has something to be postponed inside. And that contract didn't work well for string interpolation containing some postponed calls. Thus, we haven't run a completion results writing for them properly, thus leaving type parameters (K from synthetic call) for expression types instead of an inferred substituted type. In this commit, the contract was reversed to explicitly enumerate the cases when it's safe to resolve the candidate outside PCLA session. See the comments at `mightBeAnalyzedAndCompletedIndependently`. ^KT-65341 Fixed
This commit is contained in:
committed by
Space Team
parent
3ba8256b8d
commit
66d8f471d9
+6
@@ -1891,6 +1891,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("posptonedPCLACallInsideStringInterpolation.kt")
|
||||
public void testPosptonedPCLACallInsideStringInterpolation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/builderInference/posptonedPCLACallInsideStringInterpolation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt")
|
||||
public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception {
|
||||
|
||||
Generated
+6
@@ -1891,6 +1891,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT
|
||||
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("posptonedPCLACallInsideStringInterpolation.kt")
|
||||
public void testPosptonedPCLACallInsideStringInterpolation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/builderInference/posptonedPCLACallInsideStringInterpolation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt")
|
||||
public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception {
|
||||
|
||||
+6
@@ -1891,6 +1891,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("posptonedPCLACallInsideStringInterpolation.kt")
|
||||
public void testPosptonedPCLACallInsideStringInterpolation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/builderInference/posptonedPCLACallInsideStringInterpolation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt")
|
||||
public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception {
|
||||
|
||||
+6
@@ -1891,6 +1891,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
|
||||
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("posptonedPCLACallInsideStringInterpolation.kt")
|
||||
public void testPosptonedPCLACallInsideStringInterpolation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/builderInference/posptonedPCLACallInsideStringInterpolation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt")
|
||||
public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user