Skip to content

Fix isUnquotedKey check to allow reserved names - #3487

Merged
natefaubion merged 1 commit into
masterfrom
fix-3482
Dec 21, 2018
Merged

Fix isUnquotedKey check to allow reserved names#3487
natefaubion merged 1 commit into
masterfrom
fix-3482

Conversation

@hdgarrood

Copy link
Copy Markdown
Contributor

Fixes #3482. We have allowed reserved names (like data or type) to
be used as record labels without being quoted since #699 was resolved.
This commit makes the isUnquotedKey function aware of this, having the
effect that these labels are no longer unnecessarily quoted in error
messages. For example, if we enter

> {} :: { data :: Int }

in the repl, we now receive:

Error found:

  Type of expression lacks required label data.

while checking that expression {}
  has type { data :: Int
           }

whereas previously, data would have been quoted.

Fixes #3482. We have allowed reserved names (like `data` or `type`) to
be used as record labels without being quoted since #699 was resolved.
This commit makes the `isUnquotedKey` function aware of this, having the
effect that these labels are no longer unnecessarily quoted in error
messages. For example, if we enter

    > {} :: { data :: Int }

in the repl, we now receive:

    Error found:

      Type of expression lacks required label data.

    while checking that expression {}
      has type { data :: Int
               }

whereas previously, `data` would have been quoted.

@garyb garyb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@natefaubion
natefaubion merged commit 8424d52 into master Dec 21, 2018
@natefaubion
natefaubion deleted the fix-3482 branch December 21, 2018 05:55
@garyb garyb mentioned this pull request Jan 12, 2019
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pretty-printer incorrectly considers reserved ps names as needing quoting

3 participants