Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes the parent-to-child translation of async functions.
The prior code assumed that the type of the destination place an async function returns from is the same as the type of
_0
in the child. However it is insteadPoll<...>
. This adds the requisite projections to the destination place to make this work out. In particular it adds aDowncast
(becausePoll
is an enum and theReady
variant is the one that carries the actual result) and aField
projection (because a variant downcast is always followed by a projection onto one of the fields).I also refactored
translate_to_parent
slightly so it is just one match statement. I think that is clearer.We should probably add some test cases for this but I've verified that this works in the Paralegal tests.