Files
kotlin-fork/backend.native/tests/external/codegen/blackbox/when/whenArgumentIsEvaluatedOnlyOnce.kt
T
Ilya Matveev 1b553ebfaf backend/tests: Add blackbox tests from Kotlin JVM
Added tests from testData/codegen/box directory. There are blackbox tests
in other directories and they are to be added.
2017-01-20 14:04:04 +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"
}