Open YourFin opened 4 years ago
Thanks for reporting this! To set expectations:
Finally, please be patient with the core team. They are trying their best with limited resources.
Ack, no, my suggestion would not work. I guess fixing this would require knowing if Foo
is in scope or not to provide an intelligent suggestion.
Quick Summary: When capitalizing a value name in source file, the compiler gives a useful error message that suggests the same name in lower case. The repl, however, does not
SSCCE
Given Test.elm defined as following:
If I try to compile Test.elm, I get the following error message:
Which is amazing. Trying the same thing directly on the repl, however, gives this result:
Which is not only confusing, and wrong advice, but I have to hit the enter key twice in order for the error to appear, which is confusing. I'm not sure how easy this would be to rectify, but I do know that it would be very confusing to a new programmer who doesn't understand that
Additional Details
It also appears that part of some of the repl internals leak with the "I think I am still parsing the
repl_input_value_
definition." line.I also admit that I only briefly looked at the relevant source, but it appears that this is a result of switching on the type of the parser output in attemptDeclOrExpr, rather than "running the compiler directly like on a source file" (I'm talking out of my ass here). Maybe this could be fixed by just verifying that the first token isn't capitalized when parsing a Parser.Declaration.Value?
I could be totally off track with that though.