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 pattern matching edge cases #65

Merged
merged 2 commits into from
Nov 28, 2021
Merged

Fix pattern matching edge cases #65

merged 2 commits into from
Nov 28, 2021

Conversation

alex-pinkus
Copy link
Owner

  • Allow type annotations on if/guard case conditions
  • Allow for var without case

The grammar defined `guard let something: Type = ...` as legal, but only
for the binding pattern case `guard let`. The `case` form,
`guard case let`, should be allowed to have those too.
Although `for let foo = ...` requires a `case` before the `let`, the
equivalent `var` does not. The easiest solve here is to make the `case`
optional for anything other than an explicit case pattern.
@alex-pinkus alex-pinkus merged commit fbb4c71 into main Nov 28, 2021
@alex-pinkus alex-pinkus deleted the pattern-fixes branch November 28, 2021 20:31
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.

1 participant