0dd09ea7de
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`.
17 lines
265 B
Kotlin
Vendored
17 lines
265 B
Kotlin
Vendored
enum class X {
|
|
B {
|
|
val value2 = "K"
|
|
|
|
val value3: String
|
|
init {
|
|
fun foo() = value2
|
|
value3 = "O" + foo()
|
|
}
|
|
|
|
override val value = value3
|
|
};
|
|
|
|
abstract val value: String
|
|
}
|
|
|
|
fun box() = X.B.value |