You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which will not compile due to the word type being used as a record field name.
The following is a list of reserved words according to the code in the elm compiler: "if", "then", "else", "case", "of", "let", "in", "type", "module", "where", "import", "exposing", "as", "port"
It might be good to include them in the documentation with a warning to not name fields in Haskell that would reduce to reserved words once stripped of their prefix. Especially since the errors produced by Elm in these instances are not the most helpful:
Something went wrong while parsing a record type.
39| { type : String
^
I was expecting to see a lower-case variable, like `x` or `user`
The text was updated successfully, but these errors were encountered:
Some words in elm are considered reserved and naming a record field with one of these words will result in the generated elm files to not compile.
For example the Haskell new type
will produce the following in the Elm
Types
file:which will not compile due to the word
type
being used as a record field name.The following is a list of reserved words according to the code in the elm compiler:
"if", "then", "else", "case", "of", "let", "in", "type", "module", "where", "import", "exposing", "as", "port"
It might be good to include them in the documentation with a warning to not name fields in Haskell that would reduce to reserved words once stripped of their prefix. Especially since the errors produced by Elm in these instances are not the most helpful:
The text was updated successfully, but these errors were encountered: