Closed as not planned
Description
What happened?
When calling map()
on a receiver, the returned type is of type _Map
and tying-wise it is an abstract Receiver
, this means that when mapping a receiver that has more methods, like .close()
for merging or .reset()
for Timer
, these methods are not available anymore after .map()
is used.
What did you expect instead?
I expect the type to be preserved, so the mapped receiver can be used the same way as the original receiver.
Extra information
The only way to fix this is probably to have some mapping logic inside Receiver
itself instead of returning a new type. That or removing .map()
and just let users do the transformation themselves when consuming from the receiver.