Use access to backing field on overridden property with private setter

#KT-27772 Fixed
This commit is contained in:
Alexander Udalov
2018-10-23 16:11:09 +02:00
parent 8e1bff0e37
commit 9394caf9cf
7 changed files with 44 additions and 1 deletions
@@ -0,0 +1,18 @@
interface A {
val foo: String
}
class B : A {
override var foo: String = "Fail"
private set
fun setOK(other: B) {
other.foo = "OK"
}
}
fun box(): String {
val b = B()
b.setOK(b)
return b.foo
}