diff --git a/compiler/testData/codegen/regressions/kt772.jet b/compiler/testData/codegen/regressions/kt772.jet new file mode 100644 index 00000000000..6cad8d6ae03 --- /dev/null +++ b/compiler/testData/codegen/regressions/kt772.jet @@ -0,0 +1,25 @@ +namespace demo2 + +fun print(o : Any?) {} + +fun test(i : Int) { + var monthString : String? = "" + when (i) { + 1 => { + print(1) + print(2) + print(3) + print(4) + print(5) + } + else => { + monthString = "Invalid month" + } + } + print(monthString) +} + +fun box() : String { + for (i in 1..12) test(i) + return "OK" +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/codegen/ControlStructuresTest.java b/compiler/tests/org/jetbrains/jet/codegen/ControlStructuresTest.java index b6f0f1b3ad5..9c57f5b161c 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/ControlStructuresTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/ControlStructuresTest.java @@ -231,6 +231,11 @@ public class ControlStructuresTest extends CodegenTestCase { // System.out.println(generateToText()); } + public void testKt772() throws Exception { + blackBoxFile("regressions/kt772.jet"); +// System.out.println(generateToText()); + } + public void testQuicksort() throws Exception { blackBoxFile("controlStructures/quicksort.jet"); // System.out.println(generateToText());