dusklang / dusk

The Dusk Programming Language
Other
0 stars 0 forks source link

Allow -2^(n-1) as a literal #101

Closed zachwolfe closed 2 years ago

zachwolfe commented 3 years ago

If you try to write the following:

num: i8 = -128

...the compiler will complain that 128 doesn't fit into i8. It makes sense why this happens, but it's obviously a bug.

zachwolfe commented 2 years ago

Just checked; this case is now "fixed", however, the compiler seems to have gone too far in the other direction, by not checking the size of int literals at all, and leaving it up to the interpreter to deal with huge values. See #125