1310a65f0c
In the old backend, this was unnecessary because nested objects would reference their lambdas' captures through the original this$0. On JVM_IR, using loose capture fields means a name/descriptor clash can occur on any level of nesting, not just the top.
15 lines
224 B
Kotlin
Vendored
15 lines
224 B
Kotlin
Vendored
// FILE: 1.kt
|
|
package test
|
|
|
|
class C(val x: String) {
|
|
fun f(y: String) = C(y).g { x }
|
|
|
|
inline fun g(crossinline h: () -> String) =
|
|
{ { h() + x }() }()
|
|
}
|
|
|
|
// FILE: 2.kt
|
|
import test.*
|
|
|
|
fun box() = C("O").f("K")
|