elm / error-message-catalog

A catalog of broken Elm programs / data to improve error messages
BSD 3-Clause "New" or "Revised" License
173 stars 17 forks source link

Escaped characters produce weird compiler behavior #211

Closed teodorlu closed 6 years ago

teodorlu commented 7 years ago

Running this in Try Elm

import Html exposing (text)

s = "\5166904"

main =
  text s

Gives this compiler message:

elm-make: Prelude.chr: bad argument: 5166904
elm-make: thread blocked indefinitely in an MVar operation
evancz commented 6 years ago

In my developer version of things, the error message looks like this:

-- PARSE ERROR -------------------------------------------------------- temp.elm

Backslashes always start escaped characters, but I do not recognize this one:

3| s = "\5166904"
        ^
Maybe there is some typo?

Hint: Valid escape characters include:

    \n
    \r
    \t
    \"
    \'
    \\
    \u{03BB}

The last one lets encode ANY character by its Unicode code point, so use that
for anything outside the ordinary six.

Thank you for the report!