Shared types, generics, and async*

@claudio, The following is throwing an error:

public func chain<S1, S2, ErrorType>(
    x : Star<S1, Error>,
    y : S1 -> async* Star<S2, ErrorType>
  ) : async* Star<S2, ErrorType> {

I’m guessing that Generics just don’t work with async or async* since there is no way to guarantee that they are shareable results. I just want to make sure I’m not missing some sneaky way to do this that isn’t obvious.

3 Likes

I would love this feature :grin: , at the very least if we could do it for async* that would be amazing!

1 Like

It’s on my backlog. I’d even like to relax it for async, not just async*.

4 Likes

+1 for this feature. It would be great for creating more user-friendly interfaces.

I encountered this issue today, where I had to resort to passing the return value as an input parameter to a callback function.