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

Confusion between type name and variant name shadowing #349

Open wolfadex opened 3 years ago

wolfadex commented 3 years ago

There are periodically users of Elm who write code like

type Change
    = Increment

type Increment
    = ByOne
    | ByTwo

and are confused that the type Increment doesn't correspond to the variant Increment. They don't realize that they actually need to write

type Change
    = Increment Increment

type Increment
    = ByOne
    | ByTwo

to get their intended result.

real world example from May 20th, 2021