Skip to content

Conversation

@JustusAdam
Copy link
Contributor

@JustusAdam JustusAdam commented Feb 8, 2024

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 instead Poll<...>. This adds the requisite projections to the destination place to make this work out. In particular it adds a Downcast (because Poll is an enum and the Ready variant is the one that carries the actual result) and a Field 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.

@JustusAdam JustusAdam force-pushed the async-return-projection branch from f0c8cf0 to 5bc82f6 Compare February 8, 2024 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant