diff --git a/js/js.tests/test/org/jetbrains/k2js/test/semantics/PatternMatchingTest.java b/js/js.tests/test/org/jetbrains/k2js/test/semantics/PatternMatchingTest.java index 755dce1002d..3622d42865b 100644 --- a/js/js.tests/test/org/jetbrains/k2js/test/semantics/PatternMatchingTest.java +++ b/js/js.tests/test/org/jetbrains/k2js/test/semantics/PatternMatchingTest.java @@ -105,4 +105,8 @@ public final class PatternMatchingTest extends SingleFileTranslationTest { public void testIfWithOneStmWhen() throws Exception { fooBoxTest(); } -} \ No newline at end of file + + public void testWhenWithOneStmWhen() throws Exception { + fooBoxTest(); + } +} diff --git a/js/js.translator/testData/patternMatching/cases/whenWithOneStmWhen.kt b/js/js.translator/testData/patternMatching/cases/whenWithOneStmWhen.kt new file mode 100644 index 00000000000..04e043ece8a --- /dev/null +++ b/js/js.translator/testData/patternMatching/cases/whenWithOneStmWhen.kt @@ -0,0 +1,22 @@ +package foo + + +fun box(): Boolean { + var result = false + val i = 1 + when (i) { + 1 -> + when (i) { + 1 -> result = true + else -> result = false + } + + else -> + when (i) { + 1 -> result = true + else -> result = false + } + } + + return result; +}