Remove bytecode text test kt15806.kt
It's not correct to expect that the backend generates the `when` in this test as tableswitch because there are only two branches. JVM IR has a cutoff in the when optimization and generates `when`s with fewer than 3 branches as if-else chains, which is probably better. Note that there's also a corresponding box test in when/enumOptimization/, so the backend behavior is still tested.
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// TODO KT-36845 Generate enum-based TABLESWITCH/LOOKUPSWITCH on a value with smart cast to enum in JVM_IR
|
||||
|
||||
private fun Any?.doTheThing(): String {
|
||||
when (this) {
|
||||
is String -> return this
|
||||
is Level -> {
|
||||
when (this) {
|
||||
Level.O -> return Level.O.name
|
||||
Level.K -> return Level.K.name
|
||||
}
|
||||
}
|
||||
|
||||
else -> return "fail"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
enum class Level {
|
||||
O,
|
||||
K
|
||||
}
|
||||
|
||||
|
||||
fun box(): String {
|
||||
return "O".doTheThing() + Level.K.doTheThing()
|
||||
}
|
||||
|
||||
// 1 TABLESWITCH
|
||||
Reference in New Issue
Block a user