Closed cypheon closed 4 years ago
One thing I forgot to mention: I suspect this to be a problem with parsing / compiling, because the negative integers also appear in the generated Scheme source file. So it's probably not a runtime issue.
I managed to track down the issue to a TTC file (un)marshalling bug, which explains, why it did not occur in the REPL. The linked PR fixes this.
It seems large (>31 bits) integers somehow get mangled.
Steps to Reproduce
idris2 --exec main Integers.idr
Expected Behavior
Observed Behavior
This behavior seems to be present for a while, since the test chez015 verifies that:
Which is only working, because 351...123 becomes 351...507
The problem does not occur in the REPL:
(From my naïve point of view, it looks like the (Big)Integer is at some point interpreted as or casted to a signed int32).
Checked on macOS with Idris2 master@409357c and on Linux with Idris2 v0.1.0