Files
kotlin/compiler/testData/codegen/box/when/whenArgumentIsEvaluatedOnlyOnce.kt

14 lines
209 B
Kotlin
Vendored

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"
}