mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-17 15:54:03 +00:00
Migrate boxInline tests to new multi-file framework
This commit is contained in:
committed by
Alexander Udalov
parent
fa1f7d988e
commit
cc84aabdcf
27
compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChainSimple.kt
vendored
Normal file
27
compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChainSimple.kt
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
inline fun <T> inlineFun(arg: T, crossinline f: (T) -> Unit) {
|
||||
{
|
||||
f(arg)
|
||||
}()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
val param = "start"
|
||||
var result = "fail"
|
||||
|
||||
inlineFun("2") { a ->
|
||||
{
|
||||
result = param + a
|
||||
}()
|
||||
}
|
||||
|
||||
|
||||
return if (result == "start2") "OK" else "fail: $result"
|
||||
}
|
||||
Reference in New Issue
Block a user