JVM: ensure the $ENTRIES field is initialized before use

#KT-57784 Fixed
This commit is contained in:
Xin Wang
2023-05-04 10:17:29 +08:00
committed by Alexander Udalov
parent 79599ab69e
commit 7b4e6bae0e
17 changed files with 107 additions and 2 deletions
@@ -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()
}