Tristan
07/21/2021, 9:29 PMfun getSomething(): Something {}
val something: ReturnType<typeof getSomething> = getSomething()
It may be useful for situation where:
fun executeSomething(cb: Something.(arg: String) -> Unit) {
val something = Something()
something.cb("the arg")
}
// here the type could be different
// val cb: Parameters<executeSomething>[0] = {
val cb: SecretUser.(arg: String) -> Unit = {
println(propertyOfSomething)
}
executeSomething(cb)
I am just playing with the language šLandry Norris
07/21/2021, 9:44 PMTristan
07/22/2021, 12:55 PM