Elm-format: Negative hex numbers get corrupted

Created on 20 Aug 2020  路  5Comments  路  Source: avh4/elm-format

Screencast

-0xFFFFFFFF (valid Elm) becomes 0xFFFFFFFF00000001 (invalid Elm).

-(0xFFFFFFFF) doesn't help.
(-0xFFFFFFFF) doesn't help.
The only workaround is (negate 0xFFFFFFFF).

bug

Most helpful comment

0.8.4 is now released with this fix: https://github.com/avh4/elm-format/releases/tag/0.8.4

All 5 comments

Thanks for this! I expect to get a look at this in the next week or two. Do you happen to know what the max hex int allowed by elm-compiler is?

Looks like it breaks down around
0x7FFFFFFFFFFFFFFF :heavy_check_mark:
0x8000000000000000 :x:

experiment

Ah, okay, looks like any negative hex int will be converted into a positive hex int, with 16 digits, which Elm 0.19 doesn't allow.

Fixed in https://github.com/avh4/elm-format/pull/697, and will be in elm-format 0.8.4

0.8.4 is now released with this fix: https://github.com/avh4/elm-format/releases/tag/0.8.4

Was this page helpful?
0 / 5 - 0 ratings

Related issues

avh4 picture avh4  路  6Comments

conradwt picture conradwt  路  8Comments

avh4 picture avh4  路  5Comments

rtfeldman picture rtfeldman  路  7Comments

rtfeldman picture rtfeldman  路  4Comments