Test for KT-2281.
#KT-2281 fixed
This commit is contained in:
@@ -195,4 +195,10 @@ public final class MiscTest extends AbstractExpressionTest {
|
||||
public void testIterationOverIterator() throws Exception {
|
||||
fooBoxTest();
|
||||
}
|
||||
|
||||
public void testStringInterpolationEvaluationOrder() throws Exception {
|
||||
fooBoxTest();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user