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
The following assert fails:
fn main() { let x: i32 = -1; assert(1 - 2 == x); }
Here's the generated SSA -- as far as I can see the issue is a missing truncate after the first sub:
v2 = sub i32 0, i32 1 v4 = sub i32 1, i32 2 v5 = truncate v4 to 32 bits, max_bit_size: 33 v6 = eq v5, v2 constrain v6 return
Note that this example succeeds (explicitly state 0-1 instead of -1):
fn main() { let x: i32 = 0-1; assert(1 - 2 == x); }
and here's its SSA:
Initial SSA: acir fn main f0 { b0(): v2 = sub i32 0, i32 1 v3 = truncate v2 to 32 bits, max_bit_size: 33 v5 = sub i32 1, i32 2 v6 = truncate v5 to 32 bits, max_bit_size: 33 v7 = eq v6, v3 constrain v7 return }
assert passes
it doesn't
No response
None
Yes
The text was updated successfully, but these errors were encountered:
I've submitted a fix: #2413
Sorry, something went wrong.
Resolved by #2413 so closing
No branches or pull requests
Aim
The following assert fails:
Here's the generated SSA -- as far as I can see the issue is a missing truncate after the first sub:
Note that this example succeeds (explicitly state 0-1 instead of -1):
and here's its SSA:
Expected Behavior
assert passes
Bug
it doesn't
To Reproduce
No response
Installation Method
None
Nargo Version
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
Yes
Support Needs
No response
The text was updated successfully, but these errors were encountered: