fixed delegation sample
This commit is contained in:
parent
73854f21f3
commit
8611543623
@ -57,7 +57,8 @@ class lazy(val creator) : Delegate {
|
||||
|
||||
override fun getValue(thisRef, name) {
|
||||
if (value == Unset) {
|
||||
value = creator()
|
||||
// calculate value using thisRef as this:
|
||||
value = with(thisRef) creator()
|
||||
}
|
||||
value
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user