Labels on function literal arguments are processed properly

This commit is contained in:
Andrey Breslav
2013-08-16 20:03:50 +04:00
parent 9f90fd0938
commit db70087573
6 changed files with 30 additions and 14 deletions
@@ -2436,6 +2436,17 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
public void testForbiddenNonLocalReturnNoType() throws Exception {
doTest("compiler/testData/diagnostics/tests/functionLiterals/return/ForbiddenNonLocalReturnNoType.kt");
}
@TestMetadata("LocalReturnExplicitLabelNoParens.kt")
public void testLocalReturnExplicitLabelNoParens() throws Exception {
doTest("compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.kt");
}
@TestMetadata("LocalReturnExplicitLabelParens.kt")
public void testLocalReturnExplicitLabelParens() throws Exception {
doTest("compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.kt");
}
}
public static Test innerSuite() {
@@ -148,8 +148,8 @@ public class JetTypeCheckerTest extends JetLiteFixture {
public void testIf() throws Exception {
assertType("if (true) 1", "Unit");
assertType("if (true) 1 else 1", "Int");
assertType("if (true) 1 else return", "Int");
assertType("if (true) return else 1", "Int");
assertType("if (true) 1 else throw Exception()", "Int");
assertType("if (true) throw Exception() else 1", "Int");
assertType("if (true) throw Exception() else throw Exception()", "Nothing");
assertType("if (true) 1 else null", "Int?");