elm-format
elm-format copied to clipboard
Large number gets rewritten into a different number
While investigating around #688 I found this:
9223372036854776000 (which is what gets returned from elm repl as a value of the max hex integer parsable by Elm - 0x7FFFFFFFFFFFFFFF)
gets rewritten by elm-format into
-9223372036854775616
Thanks! I'll look into this at the same time. I think there's a point where if elm-compiler actually is interpreting things this way, then it may not be an issue with elm-format.
Related https://github.com/avh4/elm-format/issues/635
Hmm, interesting, according to Elm 0.19, (9223372036854776000 == -9223372036854775616) is True.
Yeah, so 9223372036854776000 in an Elm source file will result in elm-compiler producing the value -9223372036854775616 in the compiled javascript. So I think this is not a bug in elm-format; elm-format is replacing what was typed with what the compiler will actually interpret it as, so I think that's correct until this changes in elm-compiler.