JS: fix translation of && and || operators when their RHS declare temporary variables. See KT-16350

This commit is contained in:
Alexey Andreev
2017-02-21 13:58:20 +03:00
parent c6bfb02754
commit 66f5a12cc4
3 changed files with 19 additions and 2 deletions
@@ -0,0 +1,8 @@
fun foo(arg: Any): Boolean {
return arg == "x"
}
fun box(): String {
val values = listOf(null, "x")
return if (values[0] == null && foo(values[1]!!)) "OK" else "fail"
}