K2: Fix undesirable NEW_INFERENCE_ERROR for case of return + buildList
While plainly repeating K1 behavior might be a dumb solution, but inventing another one might be quite complicated because we need to stop fixing variables into Nothing in many cases, but probably not in all of them (see KT-58232). ^KT-58149 Fixed ^KT-58232 Related
This commit is contained in:
committed by
Space Team
parent
133992d0bc
commit
0a631ed8fc
+6
@@ -16935,6 +16935,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
runTest("compiler/testData/diagnostics/tests/inference/nothingType/reportImplicitNothingOnlyForOwnTypeParameters.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("returnAsLastStatementInLambda.kt")
|
||||
public void testReturnAsLastStatementInLambda() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/nothingType/returnAsLastStatementInLambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("selectWithNull.kt")
|
||||
public void testSelectWithNull() throws Exception {
|
||||
|
||||
+6
@@ -16935,6 +16935,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
runTest("compiler/testData/diagnostics/tests/inference/nothingType/reportImplicitNothingOnlyForOwnTypeParameters.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("returnAsLastStatementInLambda.kt")
|
||||
public void testReturnAsLastStatementInLambda() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/nothingType/returnAsLastStatementInLambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("selectWithNull.kt")
|
||||
public void testSelectWithNull() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user