Files
kotlin-fork/compiler/testData/codegen/box/argumentOrder/singleSideEffect.kt
T
pyos 3dc7b6c3ee IR: preserve argument evaluation order more carefully
1. receivers should be evaluated before named arguments;
 2. just because an argument has no side effects doesn't mean it is not
    affected by the other arguments' side effects - in that case it
    should still be evaluated in source order.

 #KT-47660 Fixed
2021-07-13 21:23:15 +03:00

9 lines
224 B
Kotlin
Vendored

fun box(): String {
var x = "c"
val call = test(c = x, b = { x = "a"; "b" }(), a = x)
return if (call == "abc") "OK" else "fail: $call != abc"
}
fun test(a: String, b: String, c: String): String =
a + b + c