mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 08:31:29 +00:00
As for SAM wrappers, the bytecode sequence
new A
dup
new B
dup
invokespecial B.<init>
invokespecial A.<init>
breaks the inliner, so instead we do
new B
dup
invokespecial B.<init>
store x
new A
dup
load x
invokespecial A.<init>
14 lines
254 B
Kotlin
Vendored
14 lines
254 B
Kotlin
Vendored
// IGNORE_BACKEND: JVM
|
|
// IGNORE_BACKEND_MULTI_MODULE: JVM
|
|
// FILE: 1.kt
|
|
package test
|
|
|
|
open class C(val x: () -> String)
|
|
|
|
inline fun f(crossinline g: () -> String) = object : C({ g() }) {}
|
|
|
|
// FILE: 2.kt
|
|
import test.*
|
|
|
|
fun box(): String = f { "OK" }.x()
|