Files
kotlin-fork/compiler/testData/codegen/box/when/enumOptimization/nullableEnum.kt
T
Nikolay Lunyak bcfafc601e Add EnumEntries to minimal-stdlib-for-tests
This change allows to revert adding `WITH_STDLIB` directive
to tests which happened at `a9343aeb`.

Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com>
2023-03-02 10:23:38 +00:00

24 lines
474 B
Kotlin
Vendored

// CHECK_CASES_COUNT: function=test count=0 TARGET_BACKENDS=JS
// CHECK_CASES_COUNT: function=test count=3 IGNORED_BACKENDS=JS
// CHECK_IF_COUNT: function=test count=3 TARGET_BACKENDS=JS
// CHECK_IF_COUNT: function=test count=0 IGNORED_BACKENDS=JS
enum class E {
A,
B
}
fun test(e: E?) = when (e) {
E.A -> "Fail A"
null -> "OK"
E.B -> "Fail B"
}
fun box(): String {
return test(null)
}
// CHECK_BYTECODE_TEXT
// JVM_IR_TEMPLATES
// 1 TABLESWITCH