-
Notifications
You must be signed in to change notification settings - Fork 464
Improve error when using '@deriving(accessors)` on a variant with a record arg #6712
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 error when using '@deriving(accessors)` on a variant with a record arg #6712
Conversation
139324f
to
251420e
Compare
it actually closes #6704 ;-) |
Thanks! Sorry I mis-typed that! |
251420e
to
87b38a6
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.
Very nice! 🎉
pcd_res; | ||
} | ||
-> | ||
let pcd_args = | ||
match pcd_args with | ||
| Pcstr_tuple pcd_args -> pcd_args | ||
| Pcstr_record _ -> assert false | ||
| Pcstr_record _ -> |
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.
Why does this appear twice?
Are there 2 different ways to trigger the error?
In any case better refactor the error message printing and avoid duplication.
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.
Ah yes, sorry I just copy pasted 👍🏼, the one is for structure gen the other is for signature gen. If it hits the case in one it will also in the other so you will only see one message.
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.
@cristianoc I've refactored it. See the following commit. Thanks!
Closes #6704
Previously
would error with:
now we get: