fixed delegation sample
This commit is contained in:
1 parent
73854f21f3
commit
8611543623
1 file changed
+2
-1
+2
-1
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user