<@U74HWEPTP> That does not work on overloaded func...
# announcements
e
@Shawn That does not work on overloaded function😞
g
Sorry. Misunderstand you. You can just specify type for your property explicitly if you have a few candidates:
Copy code
val toast: (String) -> Unit = activity::toast
âž• 1
e
That kind of work
But there seems no difference between
fun toast(x: String) = activity.toast(x)
val toast: (String) -> Unit = activity::toast
val toast = { x: String -> activity.toast(x) }
Just rewrite of the same thing in different syntax, is there any performance different?
g
yes, first one is most efficient. Only method call. 2 and 3 create additional objects: 2 - method reference and 3 - lambda (and method call of course)
e
Oh I guess I'll just use the first one to forward the method call then, so much typing needed😂