Closed SleepingShell closed 1 year ago
t.to_le_bits(32);
is failing because t does not fit into 32 bits.
You can simply do t as u4
instead of bit decomposition and then taking the first 4 bits.
t.to_le_bits(32);
is failing because t does not fit into 32 bits. You can simply dot as u4
instead of bit decomposition and then taking the first 4 bits.
Ah that makes sense, thank you. Oddly this worked on older compiler versions, which is why I thought this was a bug.
Just to confirm - casting an integer to a smaller sized integer removes the upper bits.
Aim
Successfully run the below code snippet
Expected Behavior
No error for running the code
Bug
Running the below code with
nargo prove
will throw the following error:nargo test
does not cause this issue.To Reproduce
Installation Method
Compiled from source
Nargo Version
nargo 0.13.0 (git version hash: 85965c324f7d5f813bbeffb105bba96f6ea5acfc, is dirty: false)
Additional Context
No response
Would you like to submit a PR for this Issue?
No
Support Needs
No response