Support proper frame maps for enumValues

This commit is contained in:
Mikhael Bogdanov
2021-01-27 17:19:01 +01:00
parent 1a044e5af4
commit c13f38f6df
13 changed files with 97 additions and 1 deletions
@@ -0,0 +1,46 @@
// JVM_TARGET: 1.8
// FILE: 1.kt
// WITH_RUNTIME
package test
enum class Base(val value: String) {
OK("OK"),
B("FAIL");
}
enum class Base2(val value: String) {
A("OK2"),
B("FAIL2");
}
var result = "fail"
fun foo(base: Enum<*>) {
result = base.name
}
fun foo(base: Array<out Enum<*>>) {
result = base[0].name
}
fun cond() = true
inline fun <reified T : Enum<T>, reified Y : Enum<Y>> process(a: String) {
val z = try {
enumValues<T>()
} catch (e: Exception) {
enumValues<Y>()
}
foo(z)
}
// FILE: 2.kt
import test.*
fun box(): String {
process<Base, Base2>("OK")
return result
}