e3bff290bd
Leveraging the same mechanism with $EntriesMapping as Java enums. Old (compiled with LV/AV < 1.8) enums are detected by looking for static special <get-entries> method that cannot be introduced on Kotlin enums otherwise #KT-53236
18 lines
289 B
Kotlin
Vendored
18 lines
289 B
Kotlin
Vendored
// TARGET_BACKEND: JVM_IR
|
|
// FULL_JDK
|
|
// WITH_STDLIB
|
|
|
|
// MODULE: lib
|
|
// FILE: MyEnum.kt
|
|
enum class MyEnum {
|
|
Nope, OK
|
|
}
|
|
|
|
// MODULE: caller(lib)
|
|
// !LANGUAGE: +EnumEntries
|
|
// FILE: Box.kt
|
|
@OptIn(ExperimentalStdlibApi::class)
|
|
fun box(): String {
|
|
return MyEnum.entries[1].toString()
|
|
}
|