Handle arbitrary variable as assignment LHS

(e.g., conventional compound assignment for a parameter value).
This commit is contained in:
Dmitry Petrov
2016-09-05 10:13:51 +03:00
committed by Dmitry Petrov
parent 1e3cdf300a
commit b3866d53cd
3 changed files with 53 additions and 4 deletions
@@ -17,4 +17,17 @@ fun test2() {
X1.x1++
X1.X2.x2++
X1.X2.X3.x3++
}
}
class B(var s: Int = 0)
object Host {
operator fun B.plusAssign(b: B) {
this.s += b.s
}
}
fun Host.test3(v: B) {
v += B(1000)
}