class A() : B() {
var text: String? = null
set(value) {
update()
}
}
The update() method determine if text is null and do some stuff. But text == null always returns true at first assignment. I guess that the setter function is called before assignment. How should I do if I want to call a function after assignment?
You probably could be interested in delegating the recurring logic of such properties to a property delegate. Check out observable delegates in the standard library.