mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 15:53:46 +00:00
Support default bound callable reference inlining
#KT-6884 Fixed
This commit is contained in:
20
compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/boundFunctionReference.kt
vendored
Normal file
20
compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/boundFunctionReference.kt
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// FILE: 1.kt
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
// SKIP_INLINE_CHECK_IN: inlineFun$default
|
||||
package test
|
||||
|
||||
class A(val value: String) {
|
||||
fun ok() = value
|
||||
}
|
||||
|
||||
inline fun inlineFun(a: A, lambda: () -> String = a::ok): String {
|
||||
return lambda()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return inlineFun(A("OK"))
|
||||
}
|
||||
Reference in New Issue
Block a user