Init enum entries whenever we access companion object or accessing valueOf
Fixes https://youtrack.jetbrains.com/issue/KT-43987 Fixes https://youtrack.jetbrains.com/issue/KT-43989
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
// IGNORE_BACKEND: JS
|
||||
|
||||
var l = ""
|
||||
enum class Foo {
|
||||
F;
|
||||
init {
|
||||
l += "Foo;"
|
||||
}
|
||||
object L {
|
||||
init {
|
||||
l += "Foo.CO;"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
Foo.L
|
||||
return if (l != "Foo.CO;") "FAIL: ${l}" else "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user