JS: fix translation of augmented assignment when RHS changes value of LHS

This commit is contained in:
Alexey Andreev
2016-11-21 18:47:09 +03:00
parent be196789d2
commit 40e00a62f5
7 changed files with 77 additions and 13 deletions

View File

@@ -0,0 +1,23 @@
// WITH_RUNTIME
import kotlin.test.*
var log = ""
var result = 20
fun <T> id(value: T) = value
fun box(): String {
result += if (id("true") == "true") {
result += 10
log += "true chosen"
3
}
else {
4
}
assertEquals(23, result)
assertEquals("true chosen", log)
return "OK"
}