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

Vertical bar error message wrong #330

Open adhedgehog opened 4 years ago

adhedgehog commented 4 years ago

Code:

nameChange : String -> { name : String, age : Int } -> { name : String, age : Int }
nameChange newName person =
     person | name = newName 

Error message:

-- UNEXPECTED SYMBOL ---- 

I was not expecting this vertical bar:

116|      person | name = newName 
                 ^
Vertical bars should only appear in custom type declarations. Maybe you want || instead?

This custom type suggestion is misleading because in this case I'm trying to update a record.