Files
kotlin-fork/js/js.translator/testData/box/expression/when/whenStatementWithRangeClause.kt
T
Alexey Andreev 3b3fd0fa0d JS: fix DCE limits in test data to fit new kotlin.js size
The size has increased due to new implementation of KClass
2017-10-06 18:16:51 +03:00

17 lines
463 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1109
// see KT-7683
// WhenTranslator must recognize KtWhenConditionInRange for when statement
package foo
fun box(): String {
var result = testFun(-1) + testFun(5) + testFun(50) + testFun(150)
return if (result == "[miss][hit1][miss][hit2]") "OK" else "fail"
}
fun testFun(index: Int): String {
var r = "[miss]"
when (index) {
in 0..9 -> r = "[hit1]"
in 100..200 -> r = "[hit2]"
}
return r;
}