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
I use -1 as u{X} syntax to get the unsigned max values. This doesn't seem to work in the new ssa.
-1 as u{X}
use dep::std::println; #[test] fn test_cast() { let a: u8 = -1 as u8; // "0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000000" println(a); // assert(a == 0xff); }
The above code should print out 0xff instead of MODULUS - 1
0xff
MODULUS - 1
The test should pass
A workaround for now is to replace -1 as u8 with 0-1 as u8
-1 as u8
0-1 as u8
nargo test
Compiled from source
nargo 0.9.0 (git version hash: 66cb1fd, is dirty: false)
No response
Maybe
The text was updated successfully, but these errors were encountered:
@Ethan-000 have assigned this to you, if you have questions please ask them in here.
bumping @jfecher for visibility
Sorry, something went wrong.
I would think this should be handled by https://github.com/noir-lang/noir/blob/master/crates/noirc_evaluator/src/ssa_refactor/ir/instruction.rs#L369-L377 but it seems like it is not
FieldElement
BigInt
jfecher
Ethan-000
Successfully merging a pull request may close this issue.
Aim
I use
-1 as u{X}
syntax to get the unsigned max values. This doesn't seem to work in the new ssa.Expected Behavior
The above code should print out
0xff
instead ofMODULUS - 1
Bug
The test should pass
A workaround for now is to replace
-1 as u8
with0-1 as u8
To Reproduce
nargo test
Installation Method
Compiled from source
Nargo Version
nargo 0.9.0 (git version hash: 66cb1fd, is dirty: false)
Additional Context
No response
Would you like to submit a PR for this Issue?
Maybe
Support Needs
No response
The text was updated successfully, but these errors were encountered: