Files
kotlin-fork/compiler/testData/codegen/box/when/enumOptimization/notAllEntriesAreConstants.kt
T
2022-03-12 14:30:00 +03:00

22 lines
289 B
Kotlin
Vendored

// TARGET_BACKEND: JVM_IR
enum class E {
A, B;
}
fun bar(): E = E.A
fun foo(e: E): String {
val c = when (e) {
E.B -> "B"
bar() -> "OK"
else -> "else"
}
return c
}
fun box() = foo(bar())
// CHECK_BYTECODE_TEXT
// 0 WhenMappings
// 0 TABLESWITCH