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

Misleading error message when deconstructing value taken out of a record #250

Open joonazan opened 6 years ago

joonazan commented 6 years ago

In Elm 0.18

module Main exposing (..)

type alias Record a =
    { content : a
    }

draw : Record Int -> Int
draw y =
    let
        ( x, _ ) =
            y.content
    in
        x

produces

`y` does not have a field named `content`.
The type of `y` is:
    Record Int
Which does not contain a field named `content`.

Instead, it should complain about y.content not being a tuple.