874d1c514a
Implementation is very similar to the `enumValues` intrinsic. Java enums and old (pre-1.9) Kotlin enums will be supported in a subsequent commit. #KT-59710
23 lines
472 B
Kotlin
Vendored
23 lines
472 B
Kotlin
Vendored
// TARGET_BACKEND: JVM_IR
|
|
// WITH_STDLIB
|
|
// !OPT_IN: kotlin.ExperimentalStdlibApi
|
|
// FILE: MyEnum.java
|
|
|
|
enum MyEnum {
|
|
E
|
|
}
|
|
|
|
// FILE: 1.kt
|
|
|
|
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") // TODO: remove once KT-53154 is fixed.
|
|
import kotlin.enums.*
|
|
|
|
inline fun <reified T : Enum<T>> enumEntries2(): EnumEntries<T> = enumEntries<T>()
|
|
|
|
fun foo() {
|
|
enumEntries<MyEnum>()
|
|
enumEntries2<MyEnum>()
|
|
}
|
|
|
|
// 0 INVOKESTATIC kotlin/enums/EnumEntriesKt.enumEntries
|