fixed delegation sample

This commit is contained in:
Sergey Chernov 2026-01-06 01:00:20 +01:00
parent 73854f21f3
commit 8611543623

View File

@ -57,7 +57,8 @@ class lazy(val creator) : Delegate {
override fun getValue(thisRef, name) { override fun getValue(thisRef, name) {
if (value == Unset) { if (value == Unset) {
value = creator() // calculate value using thisRef as this:
value = with(thisRef) creator()
} }
value value
} }