mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 15:53:40 +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`.
16 lines
287 B
Kotlin
Vendored
16 lines
287 B
Kotlin
Vendored
enum class X {
|
|
B {
|
|
val value2 = "K"
|
|
|
|
val anonObject = object {
|
|
override fun toString(): String =
|
|
"O" + value2
|
|
}
|
|
|
|
override val value = anonObject.toString()
|
|
};
|
|
|
|
abstract val value: String
|
|
}
|
|
|
|
fun box() = X.B.value |