Files
kotlin-fork/backend.native/tests/external/codegen/box/when/whenArgumentIsEvaluatedOnlyOnce.kt
T
2017-03-13 15:31:46 +03:00

14 lines
209 B
Kotlin

var x = 0
fun inc(): Int {
x++
return 0
}
fun box(): String {
val al = ArrayList<Int>()
when (inc()) {
in al -> return "fail 1"
else -> {}
}
return if (x == 1) "OK" else "fail 2"
}