JVM: fix inlining of default lambdas of signature (Result) -> Any

They have no `invoke` bridge, and the overridden invoke expectes a boxed
`Result` as an argument.
This commit is contained in:
pyos
2021-06-07 11:55:51 +02:00
committed by max-kammerer
parent a0a14d9e25
commit 392e4fba42
15 changed files with 104 additions and 55 deletions
@@ -0,0 +1,13 @@
// WITH_RUNTIME
// SKIP_INLINE_CHECK_IN: inlineFun$default
// IGNORE_BACKEND: JS
// FILE: 1.kt
package test
inline fun <T> inlineFun(v: T, x: (Result<T>) -> T = { it.getOrNull()!! }) =
x(Result.success(v))
// FILE: 2.kt
import test.*
fun box() = inlineFun("OK")