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(experimental): Replace most remaining match panics with errors #7536

Merged
merged 6 commits into from
Feb 26, 2025

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Feb 26, 2025

Description

Problem*

Resolves

Summary*

Replaces most remaining panic/println cases in the match compiler with friendly user errors.

The only two remaining errors are what I consider to be the meatier ones: redundant cases & unhandled cases since these require more analysis of the match tree itself. The later also typically requires constructing an example of a value that wouldn't be matched as part of the error message.

Additional Context

I've moved the frontend tests which deal with enums & matches to a new tests/enums.rs file since the frontend tests file is quite large. I'll add a comment noting where the new tests in this file are - the old ones are unchanged.

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@jfecher jfecher requested a review from a team February 26, 2025 17:23
Copy link
Collaborator

@asterite asterite left a comment

Choose a reason for hiding this comment

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

Looks great!

@jfecher jfecher added this pull request to the merge queue Feb 26, 2025
Merged via the queue into master with commit d118e17 Feb 26, 2025
102 checks passed
@jfecher jfecher deleted the jf/match-errors branch February 26, 2025 19:29
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Feb 26, 2025
chore: revert bump of base64ct to `v1.6.0` after `v1.7.0` yanked (noir-lang/noir#7541)
feat(performance): Avoid extra Brillig array offsetting for constant indices  (noir-lang/noir#7522)
feat: test error spans and messages (noir-lang/noir#7526)
chore: bump wasm-bindgen (noir-lang/noir#7535)
chore: parallelize `test_transform_program_is_idempotent` (noir-lang/noir#7539)
chore(cli): Use `noir_artifact_cli::fs` to read artifacts (noir-lang/noir#7391)
fix(experimental): Replace most remaining match panics with errors (noir-lang/noir#7536)
chore: bump external pinned commits (noir-lang/noir#7537)
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.

2 participants