diff --git a/design/mvp/CanonicalABI.md b/design/mvp/CanonicalABI.md index fd4a8f93..e7980063 100644 --- a/design/mvp/CanonicalABI.md +++ b/design/mvp/CanonicalABI.md @@ -2515,6 +2515,7 @@ async def canon_lift(opts, inst, ft, callee, caller, on_start, on_return, on_blo if opts.post_return is not None: [] = await call_and_trap_on_throw(opts.post_return, task, flat_results) else: + assert(not opts.post_return) if not opts.callback: [] = await call_and_trap_on_throw(callee, task, flat_args) assert(types_match_values(flat_ft.results, [])) diff --git a/design/mvp/Explainer.md b/design/mvp/Explainer.md index 72b3b21a..98cf7489 100644 --- a/design/mvp/Explainer.md +++ b/design/mvp/Explainer.md @@ -1288,20 +1288,20 @@ The Canonical ABI will use `realloc` both to allocate (passing `0` for the first two parameters) and reallocate. If the Canonical ABI needs `realloc`, validation requires this option to be present (there is no default). -The `(post-return ...)` option may only be present in `canon lift` -and specifies a core function to be called with the original return values -after they have finished being read, allowing memory to be deallocated and -destructors called. This immediate is always optional but, if present, is -validated to have parameters matching the callee's return type and empty -results. +The `(post-return ...)` option may only be present in `canon lift` when +`async` is not present and specifies a core function to be called with the +original return values after they have finished being read, allowing memory to +be deallocated and destructors called. This immediate is always optional but, +if present, is validated to have parameters matching the callee's return type +and empty results. 🔀 The `async` option specifies that the component wants to make (for imports) or support (for exports) multiple concurrent (asynchronous) calls. This option can be applied to any component-level function type and changes the derived Canonical ABI significantly. See the [async explainer](Async.md) for more details. When a function signature contains a `future` or `stream`, validation -requires the `async` option to be set (since a synchronous call to a function -using these types is highly likely to deadlock). +of `canon lower` requires the `async` option to be set (since a synchronous +call to a function using these types is highly likely to deadlock). 🔀 The `(callback ...)` option may only be present in `canon lift` when the `async` option has also been set and specifies a core function that is