Files
kotlin-fork/compiler/testData/codegen/boxInline/complex/swapAndWith.kt
T
2018-06-28 12:26:41 +02:00

21 lines
402 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
// NO_CHECK_LAMBDA_INLINING
// FILE: 1.kt
package test
public inline fun <T> with2(receiver: T, body: T.() -> String) = receiver.body()
// FILE: 2.kt
import test.*
fun <T : Any> test(item: T?, defaultLink: T.() -> String): String {
return with2("") {
item?.defaultLink() ?: "fail"
}
}
fun box(): String {
return test("O") {
this + "K"
}
}