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: Numeric generics with impls error #1148

Merged
merged 1 commit into from
Apr 13, 2023
Merged

Conversation

vezenovm
Copy link
Contributor

@vezenovm vezenovm commented Apr 13, 2023

Related issue(s)

Resolves #

Description

In aztec3-packages we get this error on the vec type in the Noir contracts:

error: Integer cannot be used with type error
   ┌─ /Users/aztec/Documents/GitHub/aztec3-packages/yarn-project/noir-contracts/src/contracts/zk_token_contract/../noir-aztec3/src/types/vec.nr:18:19
   │
18 │         constrain self.len as u64 < MaxLen as u64;
   │                   -------------------------------

error: aborting due to 1 previous errors

This was due to a mismatched ordering when reporting errors in the type rules. I added a regression test in the numeric_generics test under the nargo_cli.

Summary of changes

Dependency additions / changes

Test additions / changes

Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt with default settings.
  • I have linked this PR to the issue(s) that it resolves.
  • I have reviewed the changes on GitHub, line by line.
  • I have ensured all changes are covered in the description.

Documentation needs

  • This PR requires documentation updates when merged.

Additional context

@joss-aztec
Copy link
Contributor

This fixed worked for me when trying to compile the BoundedVec type in the aztec 3 contracts

@kevaundray kevaundray added this pull request to the merge queue Apr 13, 2023
Merged via the queue into master with commit 5d6e4d0 Apr 13, 2023
@kevaundray kevaundray deleted the mv/num-generic-impl-fix branch April 13, 2023 17:48
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