-
Notifications
You must be signed in to change notification settings - Fork 126
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
Fix parse panic #1071
Fix parse panic #1071
Conversation
Are empty type applications like |
Yes, those are still allowed. We could rule them out, I suppose. I think it would just be a matter of removing this line from the parser Line 749 in bcc7612
Or, we could do it at a later stage and maybe get better error messages. |
59d48fb
to
f0ec84c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just maybe add the example, and I am not sure about the paren case, but I am also not sure if it actually matters.
If you want to apply a type to an infix operator, you definitely will need parens, e.g. |
These are all related to the parsing of explicit type application forms, and the fixup pass that is supposed to attach them to function identifiers.
to a kind-checking error. This at least provides actionable feedback about where the error occurs. We should also improve the parser post-processing pass to handle these situations better, but this at least removes the panic.
Yeah, I don't see a compelling reason to rule out things like |
are supposed to interact.
f0ec84c
to
6734400
Compare
@brianhuffman I don't think that I was confused by the parens because I think of type application as a property of a name rather then expression, because in the current system only named thing can be polymorphic. |
Fix parsing/typechecking issues arising from explicit type applications occurring in unexpected places.
This change restricts some programs that were previously accepted, but were rather unusual, I think. E.g.
Is a program that used to be accepted with the same meaning as
After this patch, the first program with an error indicating that type applications are only allowed on identifiers.