Files
kotlin-fork/compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/differentInvokeSignature3.kt
T
pyos 100d2d629c JVM: inline default lambda coercions from bridge invoke
The type of the default lambda may be a subtype of the parameter type,
so we can't really generate our own coercions at all as we don't know
the precise Kotlin type of the `invoke` method.
2021-07-14 10:11:05 +02:00

15 lines
283 B
Kotlin
Vendored

// SKIP_INLINE_CHECK_IN: inlineFun$default
// FILE: 1.kt
package test
inline class C(val value: Any?)
fun foo(x: Any?): C = x as C
inline fun inlineFun(s: (C) -> Any? = ::foo): Any? = s(C("OK"))
// FILE: 2.kt
import test.*
fun box(): String = (inlineFun() as C).value as String