JS: don't translate RHS of overloaded assignment operators twice. It can break compilation in some cases, for example, when there are lambdas in RHS.

Fix #KT-12808 #KT-12807
This commit is contained in:
Alexey Andreev
2016-07-08 15:15:34 +03:00
parent 996c1b6f87
commit cb2c8edaf9
5 changed files with 57 additions and 16 deletions
@@ -0,0 +1,27 @@
package foo
var global = ""
fun log(message: String) {
global += message
}
fun test1(): String {
val list = mutableListOf<(Int) -> Unit>()
var result = ""
list += { log("<$it>") }
list += { result += "($it)" }
list += { result += "[$it]"; result += "{$it}" }
for(f in list) f(1)
return result
}
fun box(): String {
assertEquals("(1)[1]{1}", test1())
assertEquals(global, "<1>")
return "OK"
}