Skip to content
GitLab
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 5,250
    • Issues 5,250
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 575
    • Merge requests 575
  • 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 CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Merge requests
  • !4743

Implement NoFieldSelectors extension

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Adam Gundry requested to merge wip/amg/fieldselectors into master Jan 05, 2021
  • Overview 48
  • Commits 2
  • Pipelines 9
  • Changes 68

This implements the NoFieldSelectors ghc-proposal (fixes #5972 (closed)), adding an extension to disable the generation of selector functions corresponding to record fields. When this extension is enabled, record field selectors are not accessible as functions, but users are still able to use them for record construction, pattern matching and updates. See Note [NoFieldSelectors] in GHC.Rename.Env for details.

Along the way, this fixes the use of non-imported DuplicateRecordFields in GHCi with -fimplicit-import-qualified (fixes #18729 (closed)), and slightly liberalises DisambiguateRecordFields for updates (fixes #18999 (closed)).

Many thanks to @reactormonk and @fumieval for originally working on this. This MR is based on !4017 (closed) but I thought it best to open a new MR as I've revised it quite a bit both to incorporate !4467 (closed) and to tidy up some of the renamer logic. @reactormonk @fumieval please do feel free to review the further changes I've made.

Edited Jan 07, 2021 by Adam Gundry
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: wip/amg/fieldselectors