mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 08:31:28 +00:00
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
17 lines
323 B
Kotlin
Vendored
17 lines
323 B
Kotlin
Vendored
// IGNORE_BACKEND: JVM_IR
|
|
// FILE: 1.kt
|
|
// SKIP_INLINE_CHECK_IN: inlineFun$default
|
|
package test
|
|
|
|
class Item
|
|
|
|
inline fun inlineFun(number: String, getItem: ((String) -> String?) = { null }): String {
|
|
return number + (getItem(number) ?: "")
|
|
}
|
|
|
|
// FILE: 2.kt
|
|
import test.*
|
|
|
|
fun box(): String {
|
|
return inlineFun("OK")
|
|
} |