Skip to content
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

Wrong location for 'Unbound record field label' error #5073

Closed
vicuna opened this Issue Jun 15, 2010 · 4 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

commented Jun 15, 2010

Original bug ID: 5073
Reporter: @alainfrisch
Assigned to: @garrigue
Status: closed (set by @garrigue on 2012-06-20T10:05:28Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 4.00.0+dev
Category: typing
Monitored by: @hcarty @alainfrisch

Bug description

In a record literal expression, an unbound record field error is located on the field expression, not on the label.

E.g.:

{x = 1};;

   ^

Error: Unbound record field label x

For pattern records, the whole pattern is highlighted. In a sense, the behavior for expressions is better (more precisely localized), but quite misleading.

The location for the faulty identifier itself is not kept in the parse tree. Maybe one should add it?

Alain

File attachments

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 15, 2010

Comment author: @alainfrisch

Tried to do that... but stuck on updating Camlp4. I upload a proposal, in case someone wants to continue.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 13, 2012

Comment author: @alainfrisch

It seems there has been a regression: now, even for expressions, the whole record is highlighted in case of an unbound field label.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 13, 2012

Comment author: @garrigue

The syntax tree now contains all the locations necessary.
Will do it ASAP (there are many error messages to update).

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 20, 2012

Comment author: @garrigue

Fixed in trunk and 4.00, revision 12607.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.