-
Notifications
You must be signed in to change notification settings - Fork 563
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
Improve Parser Error Message When Using Malformed Function Argument #3825
Comments
Note, this is only in the repl. The error from
This is due to the parser backtracking the repl is doing. I did fix an issue with that in the polykinds branch, so I wonder if the error is better on master. |
For reference, I fixed an issue with how it accumulated errors in a |
This error is not better in master for the repl. |
I'm guessing this is the same bug I'm running into. You get similarly weird stuff in the REPL when you forget your function arrow in a lambda function:
I'll not create a duplicate issue for now and assume this is the same issue. |
I think in general the repl syntax errors are bad because we're assembling the parser out of the parser combinator language provided by the CST. If we write a proper Happy parser for the repl then the syntax error ought to be on par with those from the compiler, I think. |
As a PS newbie coming from Haskell, I tried to do the following:
not realizing that the correct syntax for the increment function is
(_ + 1)
. The above produces the error:It would be nice to improve that error message so that the actual problem is clearer.
The text was updated successfully, but these errors were encountered: