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