mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
Add default lambda inlining prototype
This commit is contained in:
23
compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/functionReferenceFromClass.kt
vendored
Normal file
23
compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/functionReferenceFromClass.kt
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
// FILE: 1.kt
|
||||
// SKIP_INLINE_CHECK_IN: inlineFun$default
|
||||
package test
|
||||
|
||||
fun ok() = "OK"
|
||||
|
||||
class A(val value: String) {
|
||||
fun ok() = value
|
||||
}
|
||||
|
||||
|
||||
@Suppress("NOT_YET_SUPPORTED_IN_INLINE")
|
||||
inline fun inlineFun(a: A, lambda: (A) -> String = A::ok): String {
|
||||
return lambda(a)
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return inlineFun(A("OK"))
|
||||
}
|
||||
Reference in New Issue
Block a user