-
Notifications
You must be signed in to change notification settings - Fork 790
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
Parser: more unfinished type recovery #15585
Conversation
Please don't merge it yet, I'll continue some work here tomorrow. |
How much do we care about parser recovery for missing type MissingEquals A of int There was a special case added for it some time ago, and it makes it very tricky to have any progress here. I've spent many hours today, trying to workaround it, but for now my conclusion is it seems it doesn't work well with precedence of type Abbr = int Changing the precedence of that rule seems too dangerous, because If the special case for missing I'll look into it once more tomorrow. |
For DU & enums, it is not frequent, but when switching from other languages to F#, I sometimes miss it on records and classes. But since the error message is giving what the end user needs:
I feel that the recovery for this particular case doesn't make it a big issue, especially if it comes with a code fix. I'm wondering also, if FCS wouldn't benefit from a using stale type checking results, whenever the syntax tree comes broken, if there was a way to split the "dirty" segment and recompose the parts? |
My guess is they would also type |
I think it is a good tradeoff to bring in your change as it is. |
f883bc0
to
ac36b8c
Compare
Thanks for your reply! Yes, I've dropped that rule, and it simplified things considerably. It has also allowed improving errors and ranges in other places. |
This is ready. @psfinaki Thanks a lot for helping with the change! |
Continues #15410 and adds recovery for a missed case: