xun su
11/20/2022, 1:15 AMtype Fn = (...args:any[]) -> any
but I don't know how to do it in Kotlin.Joffrey
11/20/2022, 1:18 AMAny?
is the supertype of all types, so you could use that for arguments and the return value. If you also want a variable number of arguments, you can use `vararg`:
fun takeAnything(vararg args: Any?): Any?
xun su
11/20/2022, 1:25 AMval something = mapOf<String,???>("+" to ::plus, "-" to :: sub)
what should I put here instead of ??? it is a functionhfhbd
11/20/2022, 1:29 AMRuckus
11/20/2022, 1:29 AMFunction<*>
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-function.htmlRuckus
11/20/2022, 1:31 AMxun su
11/20/2022, 1:34 AMxun su
11/20/2022, 1:34 AMJoffrey
11/20/2022, 1:35 AM<...>
in the wrong place, they should be between mapOf
and the opening parenthesisxun su
11/20/2022, 1:35 AMxun su
11/20/2022, 1:35 AMxun su
11/20/2022, 1:35 AMxun su
11/20/2022, 1:36 AMhfhbd
11/20/2022, 1:37 AMxun su
11/20/2022, 1:43 AM