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

Tweak unbound record field error message #7064

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

zth
Copy link
Collaborator

@zth zth commented Oct 1, 2024

Tweaking the error message for unbound record fields slightly. Interested in feedback on if you think this message is an improvement over the current, which reads roughly like:

  The record field knownKey can't be found.
 If it's defined in another module or file, bring it into scope by:
  - Prefixing it with said module name: TheModule.knownKey
  - Or specifying its type:
  let theValue: TheModule.theType = {knownKey: VALUE}

So, just changing the wording slightly.

@fhammerschmidt
Copy link
Member

Maybe more like "could not be found in the scope of this file" or something. The "automatically" reads to me like there is some magic going on.

@cknitt
Copy link
Member

cknitt commented Oct 2, 2024

How about

   knownKey refers to a record field, but no corresponding record type is in scope.
 If it is defined in another module or file, bring it into scope by:
  - Prefixing the field name with the module name: TheModule.knownKey
  - Or specifying the record type explicitly:
  let theValue: TheModule.theType = {knownKey: VALUE}

@zth
Copy link
Collaborator Author

zth commented Oct 2, 2024

How about

   knownKey refers to a record field, but no corresponding record type is in scope.
 If it is defined in another module or file, bring it into scope by:
  - Prefixing the field name with the module name: TheModule.knownKey
  - Or specifying the record type explicitly:
  let theValue: TheModule.theType = {knownKey: VALUE}

Great, updated! Merging.

@zth zth enabled auto-merge (squash) October 2, 2024 13:17
@cknitt
Copy link
Member

cknitt commented Oct 2, 2024

@zth You only updated the first line though.

@zth
Copy link
Collaborator Author

zth commented Oct 2, 2024

@cknitt check again.

@zth zth merged commit beb79ef into master Oct 2, 2024
19 checks passed
@zth zth deleted the unbound-record-field-error-message branch October 2, 2024 14:16
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.

3 participants