mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 15:53:46 +00:00
The reference can be lowered to `this` if it is captured in the lexical scope of the corresponding enum entry, and not used by the enum entry's super constructor. Otherwise, it is lowered to `GETFIELD SomeEnum.SomeEntry`.
22 lines
361 B
Kotlin
Vendored
22 lines
361 B
Kotlin
Vendored
enum class A {
|
|
X {
|
|
val k = "K"
|
|
|
|
val anonObject = object {
|
|
inner class Inner {
|
|
val x = "O" + k
|
|
}
|
|
|
|
val innerX = Inner().x
|
|
|
|
override fun toString() = innerX
|
|
}
|
|
|
|
override val test = anonObject.toString()
|
|
};
|
|
|
|
abstract val test: String
|
|
}
|
|
|
|
fun box() = A.X.test
|