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`.
18 lines
258 B
Kotlin
Vendored
18 lines
258 B
Kotlin
Vendored
enum class X {
|
|
B {
|
|
|
|
override val value = "OK"
|
|
|
|
val bmr = B::value.get()
|
|
|
|
override fun foo(): String {
|
|
return bmr
|
|
}
|
|
};
|
|
|
|
abstract val value: String
|
|
|
|
abstract fun foo(): String
|
|
}
|
|
|
|
fun box() = X.B.foo() |