Ruckus
operator fun <T> T.invoke(action: context(T) () -> Unit) { action(this) }
val action: context(String) () -> Unit = { length } "Test"(action)
action
"Test" { length // Unresolved reference: length }
dmitriy.novozhilov
Youssef Shoaib [MOD]
sealed interface TypeWrapper<out A> { object IMPL: TypeWrapper<Nothing> } operator fun <T> T.invoke(action: context(T) (TypeWrapper<T>) -> Unit) { action(this, TypeWrapper.IMPL) }
A modern programming language that makes developers happier.