Skip to content

[5.5][Parse] Don't skip '}' when recovering from 'default' outside 'switch' #38115

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

rintaro
Copy link
Member

@rintaro rintaro commented Jun 25, 2021

Cherry-pick #38036 into release/5.5

  • Explanation: Fixes an assertion failure in code completion. Previously, when the parser finds case or default outside switch statement, it skips to the next : or EOF ignoring the end of the function body (i.e. }). This behavior is not only undesirable for the error recovery, but causes an assertion failure in code completion.
  • Scope: Parser recovery for case/default outside switch
  • Risk: Low
  • Testing: Added regression test cases for code completion
  • Issue: rdar://78781163
  • Reviewer: Alex Hoppen (@ahoppen)

That caused assertion failures in code completion.

rdar://78781163
(cherry picked from commit aa182ac)
@rintaro rintaro added the r5.5 label Jun 25, 2021
@rintaro rintaro requested a review from a team as a code owner June 25, 2021 23:36
@rintaro
Copy link
Member Author

rintaro commented Jun 25, 2021

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Jun 28, 2021

@swift-ci Please nominate

@rintaro
Copy link
Member Author

rintaro commented Jun 29, 2021

Windows failure was unrelated. Merging.

@rintaro rintaro merged commit 1b6f3a8 into swiftlang:release/5.5 Jun 29, 2021
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.5 labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants