-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
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
Valid uint64 literal says -72057594037927936 can't be converted to uint64. #14522
Labels
Comments
Hmm Recruit_main707, pointed out that cast works echo cast[uint64](0xFF00000000000000) Very strange! |
Hmm leorize, points out that: echo 0xFF00000000000000u64 Also works! |
update as of 3ceaf5c when true:
# echo 0xFF000000_00000000.uint64 # Error: -72057594037927936 can't be converted to uint64
echo 0xFF000000_00000000'u64 # ok
const a = 0xFF000000_00000000
# echo a.uint64 # Error: -72057594037927936 can't be converted to uint64
# var b: uint64 = a # Error: type mismatch: |
Duplicate of #12700 let x = 0xFF000000_00000000
echo uint64(x) works |
Thank you! Great fix. |
narimiran
pushed a commit
that referenced
this issue
Sep 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://play.nim-lang.org/#ix=2nY6
I think its treating all hex literals as signed int64, so it can't accept one that has a negative bit set. Some where in some conversions this happens?
My compiler:
The text was updated successfully, but these errors were encountered: