mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
In an inner class of the enum entry class, enum entry reference should be generated as an outer 'this', not as a enum entry access, because enum entry itself may be not initialized yet.
20 lines
276 B
Kotlin
Vendored
20 lines
276 B
Kotlin
Vendored
// LANGUAGE_VERSION: 1.2
|
|
|
|
enum class A {
|
|
X {
|
|
val x = "OK"
|
|
|
|
inner class Inner {
|
|
val y = x
|
|
}
|
|
|
|
val z = Inner()
|
|
|
|
override val test: String
|
|
get() = z.y
|
|
};
|
|
|
|
abstract val test: String
|
|
}
|
|
|
|
fun box() = A.X.test |