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`.
20 lines
280 B
Kotlin
Vendored
20 lines
280 B
Kotlin
Vendored
enum class X {
|
|
B {
|
|
val k = "K"
|
|
|
|
inner class Inner {
|
|
fun foo() = "O" + k
|
|
}
|
|
|
|
val inner = Inner()
|
|
|
|
val bmr = inner::foo
|
|
|
|
override val value = bmr.invoke()
|
|
};
|
|
|
|
abstract val value: String
|
|
}
|
|
|
|
fun box() = X.B.value
|