We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Define constant unsigned integers, and summing them beyond their type boundaries.
E.g. given u8's boundary goes from 0 to 255, both of the following examples should fail:
u8
fn main(x : u8, y : u8) { x + y; }
with
x = "255" y = "255"
fn main() { let x : u8 = 255; let y : u8 = 255; x + y; }
Proving (1) fails with Assertion failed: 'attempt to add with overflow' as expected.
Assertion failed: 'attempt to add with overflow'
Proving (2) however did not result in any errors.
Binary
(Nightly)
nargo version = 0.18.0 noirc version = 0.18.0+a0985412594c5cbd35551afc7e94cb444723adb0 (git version hash: a098541, is dirty: false)
Discovered while drafting examples in #3393.
No
No response
The text was updated successfully, but these errors were encountered:
Assigning P-LOW under the assumption that this is a minor bug that does not affect a lot of users.
P-LOW
Please vote with emojis if your project is affected by this bug.
Sorry, something went wrong.
guipublic
Successfully merging a pull request may close this issue.
Aim
Define constant unsigned integers, and summing them beyond their type boundaries.
Expected Behavior
E.g. given
u8
's boundary goes from 0 to 255, both of the following examples should fail:u8
inputs together to beyond the type boundary:with
u8
constants together to beyond the type boundary:Bug
Proving (1) fails with
Assertion failed: 'attempt to add with overflow'
as expected.Proving (2) however did not result in any errors.
Installation Method
Binary
Nargo Version
(Nightly)
nargo version = 0.18.0 noirc version = 0.18.0+a0985412594c5cbd35551afc7e94cb444723adb0 (git version hash: a098541, is dirty: false)
Additional Context
Discovered while drafting examples in #3393.
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered: