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

Confusing message for `UNEXPECTED CAPITAL LETTER` #307

Open jfmengels opened 4 years ago

jfmengels commented 4 years ago

I saw the following error message with Elm 0.19.1.

-- UNEXPECTED CAPITAL LETTER -------------------------------------- src/Main.elm

Declarations always start with a lower-case letter, so I am getting stuck here:

3| ToFullName : Student -> String
   ^
Try a name like toFullName instead?

Note: Here are a couple valid declarations for reference:

    greet : String -> String
    greet name =
      "Hello " ++ name ++ "!"

    type User = Anonymous | LoggedIn String

Notice that they always start with a lower-case letter. Capitalization matters!

I think the association of showing a type with a upper-case letter and the sentence Notice that they always start with a lower-case letter is a bit confusing. As in "what do you mean they always start with a lower-case letter? You showed me an example of one with an upper-case letter."