FIR DFA: drop data flow edges from postponed lambdas in return values

This is a temporary hack to avoid compiler crashes in some code that
uses builder inference, conditional early returns from lambdas, and
expected types in a certain way. It is not correct - dropping data flow
edges never is - but it is much easier to implement for now than a
proper fix.
This commit is contained in:
pyos
2022-12-06 10:04:06 +01:00
committed by teamcity
parent f2347d1954
commit 06b71f8300
10 changed files with 666 additions and 0 deletions
@@ -1219,6 +1219,12 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis
runTest("compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.kt");
}
@Test
@TestMetadata("postponedLambdaInReturn.kt")
public void testPostponedLambdaInReturn() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInReturn.kt");
}
@Test
@TestMetadata("postponedLambdas.kt")
public void testPostponedLambdas() throws Exception {