JS: make string template optimization more conservative

See KT-18548
This commit is contained in:
Alexey Andreev
2017-09-19 16:42:10 +03:00
committed by Alexey Andreev
parent ca014468ee
commit b852f73dd2
3 changed files with 33 additions and 9 deletions
@@ -0,0 +1,23 @@
// EXPECTED_REACHABLE_NODES: 1024
fun box(): String {
val x = foo()
val y = bar()
var r = "$x$y"
if (r != "2342") return "fail: $r"
r = "$y$x"
if (r != "4223") return "fail: $r"
r = "$x$x"
if (r != "2323") return "fail: $r"
r = "$y$y"
if (r != "4242") return "fail: $r"
return "OK"
}
fun foo(): Any = 23
fun bar() = 42