[FIR] Fix CFG/DFA for delegate properties within PCLA

^KT-65262 Fixed
This commit is contained in:
Brian Norman
2024-02-06 13:17:50 -06:00
committed by Space Team
parent 1f904aef55
commit c8e77aad91
22 changed files with 144 additions and 2 deletions
@@ -2791,6 +2791,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt");
}
@Test
@TestMetadata("pclaRootIsTrySyntheticCallWithDelegate.kt")
public void testPclaRootIsTrySyntheticCallWithDelegate() throws Exception {
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCallWithDelegate.kt");
}
@Test
@TestMetadata("posptonedPCLACallInsideStringInterpolation.kt")
public void testPosptonedPCLACallInsideStringInterpolation() throws Exception {
@@ -2791,6 +2791,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt");
}
@Test
@TestMetadata("pclaRootIsTrySyntheticCallWithDelegate.kt")
public void testPclaRootIsTrySyntheticCallWithDelegate() throws Exception {
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCallWithDelegate.kt");
}
@Test
@TestMetadata("posptonedPCLACallInsideStringInterpolation.kt")
public void testPosptonedPCLACallInsideStringInterpolation() throws Exception {
@@ -2791,6 +2791,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt");
}
@Test
@TestMetadata("pclaRootIsTrySyntheticCallWithDelegate.kt")
public void testPclaRootIsTrySyntheticCallWithDelegate() throws Exception {
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCallWithDelegate.kt");
}
@Test
@TestMetadata("posptonedPCLACallInsideStringInterpolation.kt")
public void testPosptonedPCLACallInsideStringInterpolation() throws Exception {
@@ -394,9 +394,9 @@ open class FirDeclarationsResolveTransformer(
if (isImplicitTypedProperty) {
property.resolveSetter(mayResolveSetterBody = true, shouldResolveEverything = shouldResolveEverything)
}
dataFlowAnalyzer.exitDelegateExpression(delegateContainer)
}
dataFlowAnalyzer.exitDelegateExpression(delegateContainer)
}
}
@@ -0,0 +1,23 @@
// WITH_STDLIB
// ISSUE: KT-65262
interface Consumer<in T>
public fun <T> buildConsumer(
block: (Consumer<T>) -> Unit
): T = "OK" as T
fun expectConsumerString(x: Consumer<String>) {}
fun box() =
try {
buildConsumer { x ->
val y by lazy {
expectConsumerString(x)
"OK"
}
if (y.length != 2) throw RuntimeException("fail 1")
}
} finally {
}
@@ -2791,6 +2791,12 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt");
}
@Test
@TestMetadata("pclaRootIsTrySyntheticCallWithDelegate.kt")
public void testPclaRootIsTrySyntheticCallWithDelegate() throws Exception {
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCallWithDelegate.kt");
}
@Test
@TestMetadata("posptonedPCLACallInsideStringInterpolation.kt")
public void testPosptonedPCLACallInsideStringInterpolation() throws Exception {
@@ -2611,6 +2611,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt");
}
@Test
@TestMetadata("pclaRootIsTrySyntheticCallWithDelegate.kt")
public void testPclaRootIsTrySyntheticCallWithDelegate() throws Exception {
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCallWithDelegate.kt");
}
@Test
@TestMetadata("posptonedPCLACallInsideStringInterpolation.kt")
public void testPosptonedPCLACallInsideStringInterpolation() throws Exception {
@@ -2791,6 +2791,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt");
}
@Test
@TestMetadata("pclaRootIsTrySyntheticCallWithDelegate.kt")
public void testPclaRootIsTrySyntheticCallWithDelegate() throws Exception {
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCallWithDelegate.kt");
}
@Test
@TestMetadata("posptonedPCLACallInsideStringInterpolation.kt")
public void testPosptonedPCLACallInsideStringInterpolation() throws Exception {
@@ -2791,6 +2791,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt");
}
@Test
@TestMetadata("pclaRootIsTrySyntheticCallWithDelegate.kt")
public void testPclaRootIsTrySyntheticCallWithDelegate() throws Exception {
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCallWithDelegate.kt");
}
@Test
@TestMetadata("posptonedPCLACallInsideStringInterpolation.kt")
public void testPosptonedPCLACallInsideStringInterpolation() throws Exception {
@@ -2433,6 +2433,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt");
}
@TestMetadata("pclaRootIsTrySyntheticCallWithDelegate.kt")
public void testPclaRootIsTrySyntheticCallWithDelegate() throws Exception {
runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCallWithDelegate.kt");
}
@TestMetadata("posptonedPCLACallInsideStringInterpolation.kt")
public void testPosptonedPCLACallInsideStringInterpolation() throws Exception {
runTest("compiler/testData/codegen/box/builderInference/posptonedPCLACallInsideStringInterpolation.kt");