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
Closed

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

vicuna opened this issue Jun 15, 2010 · 4 comments
Assignees

Comments

@vicuna
Copy link

vicuna 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
Copy link
Author

vicuna 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
Copy link
Author

vicuna 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
Copy link
Author

vicuna 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
Copy link
Author

vicuna 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
Projects
None yet
Development

No branches or pull requests

2 participants