[Async CC] Test: Mark functions that call async functions async. #34402
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.
To unblock the SIL verification that async functions are called only from async functions, update the tests to meet this invariant. To enable this, in particular,
@main
had to be marked@async
untilTask.runDetached
is available. To allow that, a couple of small workaround were commited in their own commit. Reverting that commit when possible is tracked by rdar://problem/70597390.This process revealed an issue with AsyncContextLayout's usage of NecessaryBindings. Specifically, if an async function happens to use the same generic parameter twice, space was only made in the layout for one usage. That can't work for async callees which actually have two distinct generic parameters since they will need to bind the two distinct generic parameters separately since in general they will not be the same type even though at a particular call site they happened to be the same. To address this, make NecessaryBindings use a vector rather than a set to collection generic requirements.