elm / error-message-catalog

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

foo : () String Float parses but gives confusing type mismatch #188

Open rtfeldman opened 7 years ago

rtfeldman commented 7 years ago

I'd expect this to give me a parsing error:

foo : () String Float
foo =
    ( "foo", 3.2 )

Instead it parses and gives me a nonsensical type mismatch:

-- TYPE MISMATCH ---------------------------------------------------------------

The definition of `foo` does not match its type annotation.

 8| foo : () String Float
 9| foo =
10|>    ( "foo", 3.2 )

The type annotation for `foo` says it is a:

    ( String, Float )

But the definition (shown above) is a:

    ( String, Float )