Skip to content

[Typed throws] Properly reabstract closure types with originally-indirect errors #69767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

DougGregor
Copy link
Member

Big thanks to @rjmccall for helping me debug this

… 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.
…rect errors

Thank you, John McCall for debugging this with me!
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor enabled auto-merge November 10, 2023 02:41
@DougGregor
Copy link
Member Author

Only the last commit is new, on top of #69758

@DougGregor DougGregor mentioned this pull request Nov 10, 2023
21 tasks
@DougGregor DougGregor merged commit f9a5764 into swiftlang:main Nov 10, 2023
@DougGregor DougGregor deleted the typed-throws-closure-reabstract-fix branch November 10, 2023 07:09
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