Files
kotlin-fork/js/js.translator/testFiles/patternMatching/cases/whenExecutesOnlyOnce.kt
T
2012-02-27 21:55:58 +04:00

15 lines
151 B
Kotlin

package foo
class A() {
}
fun box() : Boolean {
var a = 0
when(A()) {
is A -> a++;
is A -> a++;
else -> a++;
}
return (a == 1)
}