Andreas Unterweger
interface RequestAuth { fun header(): Pair<String, String> } val instance = object : RequestAuth { override fun header(): Pair<String, String> = "name" to "value" }
val instance = object : RequestAuth { "name" to "value" }
diesieben07
interface RequestAuth { fun header(): Pair<String, String> companion object { inline operator fun invoke(crossinline body: () -> Pair<String, String>) = object : RequestAuth { override fun header() = body() } } }
marstran
fun interface
fun interface RequestAuth { fun header(): Pair<String, String> } val instance: RequestAuth = { "name" to "value" }
A modern programming language that makes developers happier.