I thought about whether this was an opportunity to improve error messages but wasn't sure what the improvement would be. Is it detection that a previous case already matched everything? Is it specifically noting that the case involved a variable that shadows an existing variable? Or is this something better covered with a warning rather than an error about variable shadowing? For example:
Warning: The pattern variable "foo" shadows the definition at line 342. Patterns can only use constructors and explicit string and numeric constants. If you need to compare against a variable, use an if expression. If you intended to use a pattern variable, you can eliminate this warning by choosing a different name. Mark On Wed, Aug 2, 2017 at 4:27 PM Richard Feldman <richard.t.feld...@gmail.com> wrote: > Mark - this seems like a great addition to the error message catalog > <https://github.com/elm-lang/error-message-catalog>! I've heard of people > encountering this too. > > Seems like it should be easy enough to detect, and the compiler could > either provide a concise explanation of what's going on or link to a longer > explanation. > > -- > You received this message because you are subscribed to the Google Groups > "Elm Discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to elm-discuss+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.