Case statement with wrong indents could give better hints #225
I had a working program (elm 0.18.0), and tried to add a simple NoOp branch to my update function. I was doing a copy-paste, which accidentally added an extra space.
The compiler gave me this error, which was quite confusing.
It would have helped if the compiler saw the arrow and gave a hint: "if was supposed to be part of your existing case statement, it's not indented properly." For completeness, if you have too little indent, you get this error, which could use a similar heuristic to give the same hint.
Thank you for reporting this! I am finishing up a revamp of the compiler that is able to produce much nicer error messages. Based on your example, I made a tweak in elm/compiler@aaa2d65 to make the message super relevant! My development build is producing:
Thank you for reporting this! It makes it really easy to check if the error message is giving information that is relevant to the reader!