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
Compilation fails when tuples containing high-bit uint64 are assigned to consts. This is the case with literals and also with calculation (which is how I ran into it). It's not true of smaller integer sizes.
Example
var ok1: (uint64, array[1..2, int]) =block:
var b: array[1..2, int]
(0x8000_0000_0000_0000'u64, b)
var ok2: (seq[uint64], uint64) =block:
var x: seq[uint64]
x.add0x8000_0000_0000_0000'u64
(x, 0'u64)
var ok3: (char, uint64) =block:
('.', 1'u64+0x7FFF_FFFF_FFFF_FFFF'u64)
const ok4: array[1, uint64] =block:
var b: array[1, uint64]
b[0] =1'u64+0x7FFF_FFFF_FFFF_FFFF'u64
b
const ok5: seq[uint64] =block:
@[0x8000_0000_0000_0000'u64]
whendefined(arrbug):
const bad1: (uint64, array[1..2, int]) =block:
var b: array[1..2, int]
(0x8000_0000_0000_0000'u64, b)
whendefined(seqbug):
const bad2: (seq[uint64], uint64) =block:
var x: seq[uint64]
x.add0x8000_0000_0000_0000'u64
(x, 0'u64)
whendefined(charbug):
const bad3: (char, uint64) =block:
('.', 1'u64+0x7FFF_FFFF_FFFF_FFFF'u64)
Example Output
# bin/nim c -d:charbug what.nim
Hint: used config file '/Users/jfondren/nim/Nim/config/nim.cfg' [Conf]
Hint: used config file '/Users/jfondren/nim/Nim/config/config.nims' [Conf]
Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: what [Processing]
what.nim(30, 5) Error: cannot convert -9223372036854775808 to uint64
Additional Information
Observed in latest devel and in 0.19.4
The text was updated successfully, but these errors were encountered:
@narimiran with Nim 1.0.4 I still get all three bugs. I don't have any code that needs the bug to be fixed, so I could only confirm by running these same tests. If it's fixed in devel I'd say this issue is good to close.
Compilation fails when tuples containing high-bit uint64 are assigned to consts. This is the case with literals and also with calculation (which is how I ran into it). It's not true of smaller integer sizes.
Example
Example Output
Additional Information
Observed in latest devel and in 0.19.4
The text was updated successfully, but these errors were encountered: