An esoteric Kotlin feature I stumbled across: <htt...
# announcements
n
m
sight just cuts off for me and doesn't show any more beyond
t
The fact is that function types such as
(Foo) -> Bar
are in fact compiled to an actual interface:
Function1<Foo, Bar>
(for functions with one parameter). There are a lot of equivalent interfaces matching the number of parameters:
Function0
,
Function2
... Because those are all interfaces, then yes, a class can implement them! That's useful when you need to pass a lambda to a function and maintain some state.
d
@Michael de Kaste Paywall crap? Use incognito browser