Files
kotlin-fork/compiler/testData/codegen/boxInline/inlineArgsInplace/callArgumentReordering.kt
T
2021-08-13 18:08:52 +03:00

18 lines
404 B
Kotlin
Vendored

// WITH_RUNTIME
// NO_CHECK_LAMBDA_INLINING
// FILE: 1.kt
var s = ""
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
inline fun foo(s1: String, s2: String) = s1 + s2
// FILE: 2.kt
fun box(): String {
val t = foo(s2 = { s += "O"; "K" }(), s1 = { s += "K"; "O" }())
if (t != "OK") return "Failed: t=$t"
if (s != "OK") return "Failed: s=$s"
return "OK"
}