Skip to content

Conversation

hamishknight
Copy link
Contributor

Instead of assuming that if let <expr> is meant to be if case <expr> = ..., turn it into if let _ = <expr>, which is consistent with the fix-it we suggest.

This currently doesn't have much of an effect on the diagnostics we produce, but will be important once we start doing bidirectional inference for ExprPatterns, as it avoids unhelpful diagnostics.

Instead of assuming that `if let <expr>` is meant
to be `if case <expr> = ...`, turn it into
`if let _ = <expr>`, which is consistent with
the fix-it we suggest.

This currently doesn't have much of an effect on
the diagnostics we produce, but will be important
once we start doing bidirectional inference for
ExprPatterns, as it avoids unhelpful diagnostics.
Copy link
Member

@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.

SGTM

@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight merged commit 36e0c7d into swiftlang:main Mar 23, 2023
@hamishknight hamishknight deleted the patterns-and-rec branch March 23, 2023 20:18
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.

3 participants