Closed alaviss closed 3 months ago
Thanks for filing the issue!
The problem is not directly related to openArray
and uint16
, but instead affects all lent uint(8|16|32)
and var uint(8|16|32)
dereferences, with the reason being that vmgen
doesn't emit the necessary narrowing instructions.
A more minimized reproducer:
proc f(x: (uint8,)): lent uint8 = x[0]
echo f((128'u8,)) # echoes 0xFFFFFFFF_FFFFFF80 (as a non-hex number)
Example
Actual Output
Additional Information
high(int16)
) does not exhibit this issue.items
.