through a higher order function with a receiver pa...
# announcements
p
through a higher order function with a receiver parameter?
s
If you have
A.() -> R
then you can just pass it to anything that expects
(A) -> R
as is. No convertion needed. Same the other way.
p
Sadly you cannot just invoke a method on a separate scope by passing the receiver as first parameter

https://i.imgur.com/nioD7hO.png

https://i.imgur.com/gzbyH9t.png

That’s what I’m trying to do. The solution in the snippet below does it as long as you hint the types manually.
s
I thought you mean passing it around. What is the problem with invoking it on the reciever ?