Skip to content

Conversation

@DougGregor
Copy link
Member

Rethrows functions only throw when their closure arguments throw.
However, they are free to translate the errors thrown from the closure
arguments in any way they want, and are therefore untyped.

Ensure that calls to rethrows functions are always treated as
throwing any Error if their closure arguments throw anything.

… in calls

Match what we do in `emitThrow`. Both of these should be unified and
generalized, relying on the AST to provide the necessary conversions
rather than having SILGen re-derive them.
Rethrows functions only throw when their closure arguments throw.
However, they are free to translate the errors thrown from the closure
arguments in any way they want, and are therefore untyped.

Ensure that calls to `rethrows` functions are always treated as
throwing `any Error` if their closure arguments throw anything.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor enabled auto-merge November 9, 2023 19:30
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor merged commit 2159073 into swiftlang:main Nov 10, 2023
@DougGregor DougGregor deleted the typed-throws-rethrows-cleanup branch November 10, 2023 03:23
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