[FIR] Infer Unit type for generic lambda function if implicit return exists

Make behavior more consistent with K1

^KT-63563 Fixed
This commit is contained in:
Ivan Kochurkin
2023-12-19 20:57:21 +01:00
committed by Space Team
parent b19c496c44
commit a2cd2200d6
12 changed files with 57 additions and 47 deletions
@@ -14357,6 +14357,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/functionLiterals/return/IfWithoutElseWithExplicitType.kt");
}
@Test
@TestMetadata("LambdaReturnTypeIsUnitIfImplicitReturnExists.kt")
public void testLambdaReturnTypeIsUnitIfImplicitReturnExists() throws Exception {
runTest("compiler/testData/diagnostics/tests/functionLiterals/return/LambdaReturnTypeIsUnitIfImplicitReturnExists.kt");
}
@Test
@TestMetadata("LambdaWithParameter.kt")
public void testLambdaWithParameter() throws Exception {
@@ -14357,6 +14357,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/functionLiterals/return/IfWithoutElseWithExplicitType.kt");
}
@Test
@TestMetadata("LambdaReturnTypeIsUnitIfImplicitReturnExists.kt")
public void testLambdaReturnTypeIsUnitIfImplicitReturnExists() throws Exception {
runTest("compiler/testData/diagnostics/tests/functionLiterals/return/LambdaReturnTypeIsUnitIfImplicitReturnExists.kt");
}
@Test
@TestMetadata("LambdaWithParameter.kt")
public void testLambdaWithParameter() throws Exception {