-
Notifications
You must be signed in to change notification settings - Fork 562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misleading lex error when forgetting to access qualified identifier #3801
Comments
"Whitespace not allowed in qualified identifer" sounds okay to me, although I wonder if something like "Unexpected whitespace, expected identifier" might be clearer? |
I agree that "Unexpected whitespace, expected identifier" is clearer. Perhaps we should go with that |
I got puzzled with that kind of error too. foreign import data Foo -- missing a kind signature!
foreign import otherFunc :: Foreign -> Foreign |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a small nit, but the lex error when forgetting to access a qualified identifier seems a bit misleading. I think we could probably make this particular error more specific for the actual cause, which (imo) is likely that the user forgot to finish what they were typing. (For example, today I was looking around my file for strange whitespace characters without realizing I had just forgotten to finish what I was typing!)
For example, in the following code:
You get the lex error
Illegal whitespace character U+0020
@natefaubion suggested we could have an error that says
Whitespace not allowed in qualified identifier
or similar.You get a similar error for when you forget to access an unqualified identifier, such as
resulting in
Unexpected or mismatched indentation
(I'm not sure if the second one is as easy to clean up, but I think the first example is relatively straightforward)
Has anyone else had a similar experience, or have a suggestion for a more specific error message?
The text was updated successfully, but these errors were encountered: