KT-10785 Fixed. Change predicate that decides whether to dereference assignment target as a property accessor or as a backing field.

This commit is contained in:
Alexey Andreev
2016-02-19 11:30:34 +03:00
parent dbde566b66
commit 0a2cff9056
5 changed files with 78 additions and 19 deletions
@@ -0,0 +1,21 @@
// See https://youtrack.jetbrains.com/issue/KT-10785
package foo
class A(var x: Int) {
operator fun plusAssign(other: A) {
x += other.x
}
}
object B {
private var holder = A(42)
val foo: A
get() = holder
}
fun box(): String {
B.foo += A(23)
if (B.foo.x != 65) return "failed: ${B.foo.x}"
return "OK"
}