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
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// FILE: 1.kt
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
package test
|
||||
|
||||
interface Call {
|
||||
fun run(): String
|
||||
}
|
||||
|
||||
inline fun test(p: String, s: () -> Call = {
|
||||
object : Call {
|
||||
override fun run() = p
|
||||
}
|
||||
}) = s()
|
||||
|
||||
// FILE: 2.kt
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return test("OK").run()
|
||||
}
|
||||
Reference in New Issue
Block a user