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
Invalid number parsing for unsigned 64-bit integers > 2**63 - 1 (tkUInt64Lit not in case statement at end of GetNumber proc in compiler/lexer.nim) #723
Currently, unsigned 64-bit integers larger than 2**63 - 1 (the max value of a signed 64-bit integer) raises an error, e.g., "Error: 9223372036854775798 is not a valid number".
I believe this relates to the lack of a tkUInt64Lit type in the case statement at the end of the GetNumber proc in compiler/lexer.nim, and specifically the code path starting at line ~392.
The following code demonstrates the bug:
let w = 9223372036854775798'i64 # 2*63 - 1. Works as expected.
echo(w)
let x = 2147483647'i32 # 2**31 - 1
echo(x)
let y = 2147483647'u64 # 2**31 - 1
echo(y)
let z = 2147483648'u64 # Any number > 2**31 - 1 raises an error.
echo(z)
Note: This relates to the same code as discussed in issue #572 .