Files
kotlin/compiler/testData/codegen/box/when/enumOptimization/nullIsTheFirstEntry.kt
2019-11-19 11:00:09 +03:00

16 lines
231 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
enum class E {
A, B;
}
fun foo(e: E?): String {
val c = when (e) {
null -> "Fail: null"
E.B -> "OK"
E.A -> "Fail: A"
}
return c
}
fun box(): String = foo(E.B)