got it, i just used a setter/getter
# getting-started
j
got it, i just used a setter/getter
s
@johnfn, can I see the full code of how you did that please? would love to learn from it
j
Copy code
private lateinit var backingValue: T

  var value: T
    get() {
      if (!::backingValue.isInitialized ) {
        backingValue = build()
      }

      return backingValue
    }
    set(value) {
      backingValue = value
    }
build is the abstract method
though you have to remember to not call it from your constructor, which isn't totally ideal... eh
s
Thank you @johnfn