Tests for bug in CFA: no return in when() is now detected

This commit is contained in:
Andrey Breslav
2013-12-02 22:49:35 +04:00
parent ec39105183
commit b15b075484
6 changed files with 56 additions and 1 deletions
@@ -166,6 +166,11 @@ public class ControlFlowTestGenerated extends AbstractControlFlowTest {
doTest("compiler/testData/cfg/ReturnFromExpression.kt");
}
@TestMetadata("returnsInWhen.kt")
public void testReturnsInWhen() throws Exception {
doTest("compiler/testData/cfg/returnsInWhen.kt");
}
@TestMetadata("ShortFunction.kt")
public void testShortFunction() throws Exception {
doTest("compiler/testData/cfg/ShortFunction.kt");
@@ -1407,6 +1407,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
doTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/DeadCode.kt");
}
@TestMetadata("definiteReturnInWhen.kt")
public void testDefiniteReturnInWhen() throws Exception {
doTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/definiteReturnInWhen.kt");
}
@TestMetadata("kt1001.kt")
public void testKt1001() throws Exception {
doTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1001.kt");