Karolo
10/11/2017, 11:31 PMvar foo: ((Long) -> Unit)? = null
set(value) {
update()
}
And the problem is when setting it from another part of code like that:
Foo.foo = {it-> doSomeJobWithIt(it) }
it still after such verified call stays null. I am sure that setter is called but somehow my foo inside Foo is still null.
Is there something I am missing with variables in object's ? Thanks in advance!karelpeeters
10/11/2017, 11:37 PMfield
. Add this as the first line of your setter: field = value
.Karolo
10/12/2017, 8:36 AM