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

Get constructor argument error when bigger problem is duplicate constructor cases #303

Open ghost opened 4 years ago

ghost commented 4 years ago
type Msg
    = A String
    | B

update msg model =
    case msg of
        B str -> ...
        B -> ...

With the above code, I got this error:

-- TOO MANY ARGS ------------------------------------------------------ Main.elm

The `B` constructor needs 0 arguments, but I see 1 instead:

         B str ->
         ^^^^^
Which is the extra one? Maybe some parentheses are missing?

The bigger problem is that I've got two B cases in the case expression.