6b6d1e80f8
Enum entries are "special" kind of singletons that should be referenced as a captured 'this' instance inside during entry initialization, because corresponding static fields in enum class are not initialized yet. #KT-7257 Fixed
16 lines
241 B
Kotlin
Vendored
16 lines
241 B
Kotlin
Vendored
// LANGUAGE_VERSION: 1.2
|
|
// IGNORE_BACKEND: JS
|
|
|
|
enum class X {
|
|
B {
|
|
override val value = "OK"
|
|
|
|
override val test = ::value.get()
|
|
};
|
|
|
|
abstract val value: String
|
|
|
|
abstract val test: String
|
|
}
|
|
|
|
fun box() = X.B.test |