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
information in the typing error message could be made more precise #7316
Comments
Comment author: kosik Error messages for record can be, I think, improved in a similar way.
Ocaml compiler states that:
Like before, there are multiple ways how this error message can be improved: (1) It can be simplified: In this case, there is a problem with records (not with variants), (2) The location information can be more precise: Instead of marking the whole record definition, (3) Grammar: Replace "Fields number" with "Field number" since the compiler reports only one field number. |
Comment author: @damiendoligez "Fields" is in the plural because there are two fields involved: one in M1.t and the other in M2.t. You can read the sentence as "the fields numbered 8 are different". |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
@Octachron Well, I feel like that's also a good target for some diffing :D |
@Drup could you submit a testsuite PR that contains the current behavior, in a |
There is a label "error-messages", I suggest to assign it to this issue, it will finding all these error message improvements easier: |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
The current error message only reports
I agree that the The location could be narrowed too, but that might require more work. |
Original bug ID: 7316
Reporter: kosik
Status: acknowledged (set by @damiendoligez on 2016-11-08T10:46:34Z)
Resolution: open
Priority: low
Severity: feature
Version: 4.03.0
Target version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Category: typing
Monitored by: @gasche
Bug description
After typing:
Ocaml reports that:
I think there are multiple ways how this kind of error message can be made more useful:
(1)
It can be simplified:
If there is a problem with a variant, just report:
(i.e. omit the "or record" part if, in a given situation, the problem is not related to records).
(2)
The location information can be more precise:
(3)
Grammar.
Steps to reproduce
The text was updated successfully, but these errors were encountered: