Skip to content

Conversation

@zth
Copy link
Member

@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
Member 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
Member 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.

4 participants