Skip to content

Add safe Nix integer warning or compile error #36

@PgBiel

Description

@PgBiel

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 and 9223372036854775808 (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, without fromJSON, the literals just cause a parsing error (even if they're not evaluated). It could even straight up become a compilation error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomersnix targetRelated to the nix target's codegenupstream-parityThings missing in Glistix compared to the upstream compiler

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions