Skip to content

Swift: Fix completion for "naked" patterns #9511

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
Jun 13, 2022

Conversation

MathiasVP
Copy link
Contributor

(By "naked" pattern I mean a pattern that is not a child of a CaseLabelItem).

Previously we were seeing both a no-match and a match completion in the CFG when flowing from 42 to x for things like:

func foo() {
  var x = 42
}

because the CFG library assumed that a pattern was always a child of a CaseLabelItem. This PR fixes this issue.

…'. Previously we'd add an unnecessary 'no-match' completion to these patterns even though they were always matching. This caused some confusing output in the graph tests in particular.
@MathiasVP MathiasVP requested a review from a team as a code owner June 13, 2022 08:29
@github-actions github-actions bot added the Swift label Jun 13, 2022
@MathiasVP MathiasVP added the no-change-note-required This PR does not need a change note label Jun 13, 2022
Copy link
Contributor

@redsun82 redsun82 left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note Swift
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants