Skip to content
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

Fix up a mismatch between effect specifier lookahead and parsing #2660

Merged
merged 1 commit into from
May 21, 2024

Conversation

bnbarham
Copy link
Contributor

Lookahead was not consuming typed throw's error argument during lookahead for closures. atFunctionTypeArrow did mostly handle it, but only consumed a single token and thus wouldn't match throws(any Error). Handle this in consumeEffectsSpecifiers and then use this for both.

Fixes #2648.
Resolves rdar://127750606.

Lookahead was not consuming typed throw's error argument during
lookahead for closures. `atFunctionTypeArrow` did mostly handle it, but
only consumed a single token and thus wouldn't match `throws(any
Error)`. Handle this in `consumeEffectsSpecifiers` and then use this for
both.

Fixes apple#2648.
Resolves rdar://127750606.
@bnbarham bnbarham requested a review from DougGregor May 18, 2024 06:29
@bnbarham bnbarham requested a review from ahoppen as a code owner May 18, 2024 06:29
@bnbarham
Copy link
Contributor Author

@swift-ci please test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

Copy link
Collaborator

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@bnbarham bnbarham merged commit 76fb4cf into apple:main May 21, 2024
3 checks passed
@bnbarham bnbarham deleted the typed-throws-misparse branch May 21, 2024 00:05
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.

swift-format fails to parse valid swift code
3 participants