Local returns are only allowed with explicitly specified return types
This is a temporary limitation: otherwise type inference is having trouble to account for all the returned expressions. We will fix the inference and remove the limitation
This commit is contained in:
@@ -2472,6 +2472,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
|
||||
doTest("compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("LocalReturnsWithExplicitReturnType.kt")
|
||||
public void testLocalReturnsWithExplicitReturnType() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("MixedReturnsFromLambda.kt")
|
||||
public void testMixedReturnsFromLambda() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.kt");
|
||||
|
||||
Reference in New Issue
Block a user