Fix compound assignment on arbitrary expression in LHS

(with a convention compound assignment operator defined).
This commit is contained in:
Dmitry Petrov
2016-09-12 16:49:12 +03:00
committed by Dmitry Petrov
parent 0cdf831bf0
commit 3fa33b5969
6 changed files with 70 additions and 4 deletions
@@ -0,0 +1,21 @@
class Host {
operator fun plusAssign(x: Int) {}
fun test1() {
this += 1
}
}
fun foo() = Host()
fun Host.test2() {
this += 1
}
fun test3() {
foo() += 1
}
fun test4(a: () -> Host) {
a() += 1
}