Add safe Nix integer warning or compile error #36
Labels
enhancement
New feature or request
good first issue
Good for newcomers
nix target
Related to the nix target's codegen
upstream-parity
Things missing in Glistix compared to the upstream compiler
Milestone
Similarly to how Gleam now warns on unsafe integers on the JS target (see gleam-lang/gleam#3764), we could do the same for Nix since Nix restricts integer literals to between
-9223372036854775807
and9223372036854775808
(signed 64-bit integer values, though to get-9223372036854775808
it is necessary to write-9223372036854775807 - 1
).builtins.fromJSON
for higher literals will simply convert to float, whereas, withoutfromJSON
, the literals just cause a parsing error (even if they're not evaluated). It could even straight up become a compilation error.The text was updated successfully, but these errors were encountered: