Use access to backing field on overridden property with private setter
#KT-27772 Fixed
This commit is contained in:
+18
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user