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

Did you forget to add [] around it? #292

Closed mordrax closed 5 years ago

mordrax commented 5 years ago

image

The hint is ambiguous at best and misleading at worst suggesting that the highlighted Field Date needs to be a list. It so happens that line 28, the view function is the one that needs to return a list.

mordrax commented 5 years ago
type alias Field a =
    { raw : String
    , value : a
    , view : a -> List (Html (Msg a))
    , label : String
    , validation : a -> List String
    }
evancz commented 5 years ago

Ended up removing the hint in https://github.com/elm/compiler/commit/0cd361d54c3a56940ebf94882069adf1fbc4600e. Seems like it's actively confusing in some cases, and in general, probably very rarely the real problem.

Thank you for reporting this!