Files
kotlin/compiler/testData/codegen/box/enum/innerClassInEnumEntryClass.kt
Dmitry Petrov 66ece54b25 Fix initialization of inner class instances in enum entries
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.
2017-09-11 09:42:18 +03:00

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