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:
Andrey Breslav
2013-08-21 18:05:16 +04:00
parent d97506476f
commit 08625a6b2f
16 changed files with 52 additions and 23 deletions
@@ -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");