Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,862
    • Issues 4,862
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 458
    • Merge requests 458
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #21226
Closed
Open
Created Mar 13, 2022 by George Thomas@georgefst

OverloadedRecordDot: "label" can't be used as a field name

{-# LANGUAGE OverloadedRecordDot #-}
getLabel :: D -> ()
getLabel = \x -> x.label
getLabel = (.label)
getLabel = \x -> x.label'
getLabel = (.label')

With GHC 9.2.1, The first two definitions above are parse errors. The second two are not.

I'm pretty curious to know how this has come about. Note that the behaviour is different for actual keywords like type or data, where we get a parse error if we even try to define them as field names (side note: it would be cool if these were valid - I can't immediately think of an actual ambiguity).

Edited Mar 13, 2022 by George Thomas
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking