Lateinit val alternative suggestion

I don’t think it is possible in general to do this unless you add a much more complex (stateful) type system. You would need to annotate functions as requiring/updating state and particular states promising certain properties. This would be very invasive to the language, an interesting experiment indeed, but it probably doesn’t belong in Kotlin.

1 Like