You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The range of u128 is incorrectly specified as 0..0.
To see that, try to compile the following code:
let x:u128 = 1;
The compiler would throw an error:
error: The literal `1` cannot fit into `u128` which has range `0..=0`
Expected Behavior
The compiler should not throw an error on the above code.
Bug
Create a project with nargo new range_bug, then save the following piece of code in to src/main.nr:
fnmain(){let x:u128 = 1;}
Then run nargo check and observe the following error:
warning: unused variable x
┌─ /home/Jurarpereurs/range_bug/src/main.nr:2:9
│
2 │ let x: u128 = 1;
│ - unused variable
│
error: The literal `1` cannot fit into `u128` which has range `0..=0`
┌─ /home/Jurarpereurs/range_bug/src/main.nr:2:19
│
2 │ let x: u128 = 1;
│ -
│
Error: Aborting due to 1 previous error
Location:
crates/nargo_cli/src/cli/mod.rs:91:5
To Reproduce
Run the following commands:
nargo new range_bug
cd range_bug
cat <<EOF > src/main.nrfn main() { let x: u128 = 1;}EOF
nargo check
Installation Method
Binary
Nargo Version
nargo 0.11.1 (git version hash: 39e1433, is dirty: false)
Additional Context
No response
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:
Aim
The range of
u128
is incorrectly specified as0..0
.To see that, try to compile the following code:
The compiler would throw an error:
Expected Behavior
The compiler should not throw an error on the above code.
Bug
Create a project with
nargo new range_bug
, then save the following piece of code in tosrc/main.nr
:Then run
nargo check
and observe the following error:To Reproduce
Run the following commands:
Installation Method
Binary
Nargo Version
nargo 0.11.1 (git version hash: 39e1433, is dirty: false)
Additional Context
No response
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: