Files
kotlin-fork/js/js.translator/testData/box/expression/misc/stringInterpolationEvaluationOrder.kt
T
2018-09-12 09:49:25 +03:00

34 lines
455 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1291
package foo
var s = ""
class A() {
fun test(v: String) {
s += "4"
}
}
fun f(): String {
s += "3"
return ""
}
class B() {
val a: A
get() {
s += "2"
return A()
}
fun test() {
s += "1"
a.test("${if (true) f() else 4}")
s += "5"
}
}
fun box(): String {
B().test()
return if (s != "12345") "fail: $s" else "OK"
}