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

Improve diagnostic messages for errors in elaborating record projections #504

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kmeakin
Copy link
Contributor

@Kmeakin Kmeakin commented Feb 17, 2023

Distinguish between the three ways that RecordProj can be an error:

  • The head expression is not a record (eg Type.foo)
  • The head expression is a record, but it is empty (eg {}.foo)
  • The head expression is a non-empty record, but the field is missing (eg {x=foo}.foo)

I thought it was worth adding a separate diagnostic for accessing a field on a unit record, since a message about a missing field when there are no fields to choose from could be confusing

@Kmeakin Kmeakin force-pushed the record-proj-better-diagnostics branch from d876c48 to 49665d9 Compare February 17, 2023 06:19
@Kmeakin Kmeakin force-pushed the record-proj-better-diagnostics branch from 49665d9 to 2c152ca Compare February 17, 2023 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant