Files
kotlin/compiler/testData/codegen/boxInline/anonymousObject/superConstructorWithObjectParameter.kt
pyos 5d8aac456f JVM_IR: create temporaries for complex super constructor arguments
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>
2019-11-06 15:54:40 +01:00

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()