-
-
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
Compiler creates invalid out-of-range int8 constants. #13513
Comments
Nice to see you back. I think I implemented all your feedback. I thought we lost you. I guess this error is my fault. I simply forgot that the
In your case I would recommend to use this code: const a = high(int8)
const b = cast[int8](cast[uint8](a) + 1)
doAssert typeof(b) is int8
doAssert b == 128 # FAILS
doAssert b <= high(int8) # OK |
I just relized that fixing this bug isn't that hard. Still I would really like to deprecate these operators, or at least put them in the |
* fixes #13513 * merge tarithmetics in tarithm
The compiler creates an invalid int8 constant with the value 128.
Example
Current Output
Expected Output
The text was updated successfully, but these errors were encountered: