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

Refactor to use a dedicated MatchPattern enum instead of reusing Expression #7254

Open
jfecher opened this issue Jan 31, 2025 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@jfecher
Copy link
Contributor

jfecher commented Jan 31, 2025

Problem

Match patterns introduced in #7243 parse into Expressions for ease of implementation but we should probably refactor this into a dedicated Pattern type in the future.

Happy Case

A dedicated Pattern type would:

  • Eliminate the need for a _ => error invalid pattern case when matching expression types that are not supposed to be part of a pattern. E.g. a Lambda.
  • Allow us to add pattern syntax that is invalid in other expressions like "or" patterns using | or alias patterns using @.
  • Likely require significantly more code since we'd have a new recursive type to elaborate, handle in the language server, create a resolved variant of, etc.

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@jfecher jfecher added the enhancement New feature or request label Jan 31, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant