Files
kotlin-fork/js/js.translator/testFiles/expression/misc/cases/stringInterpolationEvaluationOrder.kt
T
Pavel V. Talanov 04da2f453a Test for KT-2281.
#KT-2281 fixed
2012-08-31 14:35:54 +04:00

33 lines
404 B
Kotlin

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(): Any? {
B().test()
return if (s != "12345") s else true
}