Files
kotlin/compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/differentInvokeSignature2.kt
Mikhael Bogdanov 6bf70a5dd2 Properly find invoke method on default lambda inlining
In general case parameter type could differ from actual default lambda type.
  E.g.: fun inlineFun(s: (Child) -> Base = { a: Base -> a as Child}),
  where type of default lambda is '(Base) -> Child'.
  In such case we should find somehow actual invoke method in bytecode knowing
  only name, number of parameters and that's actual invoke is non-synthetic
  regardless of bridge one.

  #KT-21946 Fixed
2019-01-02 12:37:06 +01:00

17 lines
288 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
// FILE: 1.kt
// SKIP_INLINE_CHECK_IN: inlineFun$default
package test
fun foo(a: Number): String = "OK"
inline fun inlineFun(s: (Double) -> String = ::foo): String {
return s(1.0)
}
// FILE: 2.kt
import test.*
fun box(): String {
return inlineFun()
}