Files
kotlin-fork/js/js.translator/testData/patternMatching/cases/doWhileWithOneStmWhen.kt
T
Michael Nedzelsky 209315baad JS backend: fix translation when statement -- now WhenTranslator returns JsBlock instead of hackish adding statements to context block.
It fixed the compiler crashing when translating `for`/`when`/`if` with `when` statement(KT-5234) and KT-5058.

 #KT-5234 fixed
 #EA-57346 fixed
 #KT-5058 fixed
2014-06-18 21:20:28 +04:00

16 lines
216 B
Kotlin

package foo
fun box(): Boolean {
var result = false
var i = 1
do
when (i) {
1 -> result = true
else -> result = false
}
while (i==0)
return result;
}