Files
kotlin-fork/compiler/testData/codegen/box/when/sealedWhenInitialization.kt
T
2018-06-14 19:54:30 +03:00

15 lines
228 B
Kotlin
Vendored

sealed class A {
object B : A()
class C : A()
}
fun box(): String {
val a: A = A.C()
val b: Boolean
when (a) {
A.B -> b = true
is A.C -> b = false
}
return if (!b) "OK" else "FAIL"
}