Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upasync(.promise) and promises (docs still accurate?) #1018
Comments
|
I imagine a multiple line attempt would be ambiguous, but possibly not (hopefully not). In general one must do multiple line attempts since one liners are inferred differently (and more leniently). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


There's a blurb at the end of the Appendix document that reads:
I wasn't sure of the exact issue behind this caution, so I spent some time trying to reproduce it, without much luck. Is it possible that current compilers handle this situation more smoothly?
E.g., this seems to work fine:
If the situation is in fact better now, it might be nice if the
async(.promise)family provided its own unwrapping when the return type of the closure was a Promise or Guarantee so that, e.g., the return type ofwould be
Promise<Int>rather thanPromise<Promise<Int>>.It's potentially a breaking change, but since the docs have historically warned away from this, maybe not a big deal for PMK7?