Files
kotlin-fork/compiler/testData/codegen/bytecodeText/enum/enumEntriesMultiMapping.kt
T
Vsevolod Tolstopyatov e3bff290bd [JVM] Lower .entries calls on Kotlin enums
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
2022-08-12 09:35:22 +00:00

30 lines
484 B
Kotlin
Vendored

// TARGET_BACKEND: JVM_IR
// FULL_JDK
// WITH_STDLIB
// MODULE: lib
// FILE: MyEnums.kt
enum class MyEnum {
N, O
}
enum class MyEnum2 {
O, K
}
// MODULE: caller(lib)
// !LANGUAGE: +EnumEntries
// FILE: Box.kt
@OptIn(ExperimentalStdlibApi::class)
object Container {
fun getK() = MyEnum2.entries[1].toString()
}
@OptIn(ExperimentalStdlibApi::class)
fun box(): String {
return MyEnum.entries[1].toString() + Container.getK()
}
// 2 class [a-zA-Z]+\$EntriesMappings