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: Add Result to acir gen #1927

Merged
merged 1 commit into from
Jul 13, 2023
Merged

fix: Add Result to acir gen #1927

merged 1 commit into from
Jul 13, 2023

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Jul 13, 2023

Description

Problem*

Resolves #1918

Summary*

Adds Result pervasively to AcirGen. I've also added Locations to each AcirGenError to improve the error messages.

Now, when running on the example code from the linked issue the compiler no longer crashes and instead issues an error message:

error: 
   ┌─ /.../aztec-packages/yarn-project/noir-contracts/src/libs/noir-aztec/src/types/vec.nr:18:16
   │
18 │         assert(self.len as u64 < MaxLen as u64);
   │                ------------------------------- Failed constraint

Error: Aborting due to 1 previous error

This error message could still be nicer (in a future PR):

  • It is in a library function rather than the original contract, so a stack trace would be very helpful (but difficult).
  • We could interpolate failing asserts more precisely. So the error could be Failed constraint: 75 < 74 (for example).

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

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

@kevaundray kevaundray added this pull request to the merge queue Jul 13, 2023
Merged via the queue into master with commit 1f8fd51 Jul 13, 2023
@kevaundray kevaundray deleted the jf/add-result-to-acir-gen branch July 13, 2023 19:04
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.

BadConstantEquality error when trying to write out of array bounds
2 participants