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>
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
// 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()
|
||||
Reference in New Issue
Block a user