mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
40 lines
718 B
Kotlin
Vendored
40 lines
718 B
Kotlin
Vendored
// FILE: 1.kt
|
|
|
|
package test
|
|
|
|
class A {
|
|
val param = "start"
|
|
var result = "fail"
|
|
var addParam = "_additional_"
|
|
|
|
inline fun inlineFun(arg: String, f: (String) -> Unit) {
|
|
f(arg + addParam)
|
|
}
|
|
|
|
fun box(): String {
|
|
inlineFun("1") { c ->
|
|
{
|
|
inlineFun("2") { a ->
|
|
{
|
|
{
|
|
result = param + c + a
|
|
}()
|
|
}()
|
|
}
|
|
}()
|
|
}
|
|
|
|
return if (result == "start1_additional_2_additional_") "OK" else "fail: $result"
|
|
}
|
|
|
|
}
|
|
|
|
// FILE: 2.kt
|
|
|
|
//NO_CHECK_LAMBDA_INLINING
|
|
import test.*
|
|
|
|
fun box(): String {
|
|
return A().box()
|
|
}
|