mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 08:31:29 +00:00
Support unbound callable function references in inliner
This commit is contained in:
17
compiler/testData/codegen/bytecodeText/callableReference/boundFunReferenceInInline.kt
vendored
Normal file
17
compiler/testData/codegen/bytecodeText/callableReference/boundFunReferenceInInline.kt
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
fun box(): String {
|
||||
return if (call(10, A()::calc) == 5) "OK" else "fail"
|
||||
}
|
||||
|
||||
class A {
|
||||
fun calc(p: Int): Int {
|
||||
return p / 2
|
||||
}
|
||||
}
|
||||
|
||||
inline fun call(p: Int, s: (Int) -> Int): Int {
|
||||
return s(p)
|
||||
}
|
||||
|
||||
// 1 NEW A
|
||||
// 1 NEW
|
||||
Reference in New Issue
Block a user