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`.
13 lines
231 B
Kotlin
Vendored
13 lines
231 B
Kotlin
Vendored
fun <T, R> T.letNoInline(fn: (T) -> R) =
|
|
fn(this)
|
|
|
|
enum class X {
|
|
B {
|
|
val value2 = "K"
|
|
override val value = "O".letNoInline { it + value2 }
|
|
};
|
|
|
|
abstract val value: String
|
|
}
|
|
|
|
fun box() = X.B.value |