error-message-catalog
error-message-catalog copied to clipboard
Confusion between type name and variant name shadowing
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