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

Typos, "did you mean" errors - filter the candidates using type information #258

Open Janiczek opened 6 years ago

Janiczek commented 6 years ago

So, we have this: naming

It could be nice to only show candidates from the list whose types agree with the usage in source code.

For example, the unknown List.nap is being used as

({a | name : String} -> Html msg) -> List {a | name : String} -> List (Html msg)

which only agrees with List.map ((a -> b) -> List a -> List b).

(Variation: not only filter but also add candidates with compatible types from all currently visible definitions.)