Just small having fun with property delegates: We ...
# announcements
m
Just small having fun with property delegates: We can make shorter substitution for
Copy code
val value get() = getValue()
if we define
Copy code
operator fun <R> (() -> R).getValue(thisRef: Any?, property: KProperty<*>): R = invoke()
we can use it this way:
Copy code
val value by { getValue() }
Useless, but funny xD Might be useful in 1.0 if we would like to have type inferred
Copy code
val a by { 1 }
val b by { "KOKO" }
val c by { 1 + 100 }
😄 2