Skip to content

[5.9] [CS] Walk UnresolvedDeclRefExprs in UnresolvedVarCollector #67340

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
merged 1 commit into from
Jul 20, 2023

Conversation

hamishknight
Copy link
Contributor

5.9 cherry-pick of #67332

  • Explanation: Fixes a bogus error message that could appear when attempting to use a switch expression in a single-expression closure with a capture list that is referenced by one of the switch patterns.
  • Scope: Affects switch expressions
  • Issue: rdar://112264204
  • Risk: Low, expands an existing bit of logic to cover more cases
  • Testing: Added tests to test suite
  • Reviewer: Pavel Yaskevich

This matches what we do in VarRefCollector, and is
needed because we currently delay the pre-checking
of patterns due to the fact that we don't resolve
them until CSGen. We ought to consider changing
this, but until then, adjust the logic here to
ensure we properly connect an ExprPattern that
references an outer var with any type variables
it may involve.

rdar://112264204
@hamishknight hamishknight requested a review from a team as a code owner July 17, 2023 19:25
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight added swift 5.9 🍒 release cherry pick Flag: Release branch cherry picks labels Jul 17, 2023
@hamishknight hamishknight merged commit 68c464f into swiftlang:release/5.9 Jul 20, 2023
@hamishknight hamishknight deleted the connextras-5.9 branch July 20, 2023 14:36
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.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants