JVM: ensure the $ENTRIES field is initialized before use
#KT-57784 Fixed
This commit is contained in:
committed by
Alexander Udalov
parent
79599ab69e
commit
7b4e6bae0e
@@ -0,0 +1,16 @@
|
||||
// !LANGUAGE: +EnumEntries
|
||||
// IGNORE_BACKEND: JVM, JS
|
||||
// WITH_STDLIB
|
||||
|
||||
enum class MyEnum {
|
||||
OK, NOPE;
|
||||
|
||||
companion object {
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
val ok = entries[0]
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return MyEnum.ok.toString()
|
||||
}
|
||||
Reference in New Issue
Block a user