Lazy extension properties


Can an extension property be lazy?

This works:

val Int get() {
    return keep.size

this gives me an error: “unresolved reference: keep”:

val Kos.keepCount: Int by lazy {


No. A lazy property requires storing state (the evaluated value), and there is no way to add state to an existing object from an extension property.