Handle arbitrary variable as assignment LHS
(e.g., conventional compound assignment for a parameter value).
This commit is contained in:
committed by
Dmitry Petrov
parent
1e3cdf300a
commit
b3866d53cd
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user