Hamza
10/12/2019, 12:28 AMimport kotlin.reflect.KProperty
object Items {
val x by SomeProperty("x")
val y by SomeProperty("y")
val z by SomeProperty("z")
}
fun main() {
println("a")
println(Items.x)
println("b")
}
class SomeProperty(val name: String) {
init {
println("Property $name was created")
}
operator fun getValue(ref: Any?, prop: KProperty<*>) = name
}
Hey guys, Is there a way to get around the fact that the properties are initialized lazily?