Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Record definition whitespace #255
Consider the following elm program that does nothing but fail to compile:
Compiler error says:
This is definitely a correct error message
In some areas in the docs about records it would seem that records aren't indentation or white-space sensitive, but maybe the error message could give an example of a style-guide-conforming record definition, like this:
And perhaps a link, reference, or a short blurb on the reasoning about this, or maybe just something like "record definitions like this example one are definitively unambiguous, and sticking to it will ensure your program is readable by other elm programmers and quickly compilable"..?
One thing that's interesting is the type alias definition compiles fine, but to get the record definition to work you just need to add at least one space on the last line.
I am finishing up an overhaul of the parser that makes it easier to give more precise error messages for syntax problems. This report encouraged me to make one last tweak in elm/compiler@11ffbf5 so my development build is now giving the following message for your code:
Thanks for reporting this case! The improved version should become available along with a bunch of other improvements once Elm 0.19.1 is released.