[Typed throws] Record thrown error types and conversions in the AST

For any operation that can throw an error, such as calls, property
accesses, and non-exhaustive do..catch statements, record the thrown
error type along with the conversion from that thrown error to the
error type expected in context, as appropriate. This will prevent
later stages from having to re-compute the conversion sequences.
This commit is contained in:
Doug Gregor
2023-10-24 09:13:33 -07:00
parent 7c6dacb06b
commit 5ad39c84e0
19 changed files with 334 additions and 75 deletions

View File

@@ -333,7 +333,7 @@ deriveBodyDistributed_thunk(AbstractFunctionDecl *thunk, void *context) {
auto *makeInvocationArgs = ArgumentList::createImplicit(C, {});
auto makeInvocationCallExpr =
CallExpr::createImplicit(C, makeInvocationExpr, makeInvocationArgs);
makeInvocationCallExpr->setThrows(false);
makeInvocationCallExpr->setThrows(nullptr);
auto invocationEncoderPB = PatternBindingDecl::createImplicit(
C, StaticSpellingKind::None, invocationPattern, makeInvocationCallExpr,