Disambiguate record selectors by type signature
ClosedPublic

Authored by adamgundry on Oct 28 2015, 12:07 PM.

Details

Summary

This makes DuplicateRecordFields more liberal in when it will
accept ambiguous record selectors, making use of type information in a
similar way to updates. See Note [Disambiguating record fields] for more
details (and I'll update the wiki page when I have time)...

It builds on D1331 because I'm lazy.

Test Plan

New and amended tests in overloadedrecflds

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
adamgundry retitled this revision from to Disambiguate record selectors by type signature.Oct 28 2015, 12:07 PM
adamgundry updated this object.
adamgundry edited the test plan for this revision. (Show Details)
adamgundry updated this revision to Diff 4770.Oct 29 2015, 4:50 PM

Refactoring and minor bug fixes

  • Handle record selectors properly in Template Haskell
  • Refactor disambiguateRecordBinds and make errors more uniform
  • Handle non-fields appearing in updates
  • More refactoring and fixing of comments
  • Refactor to make lint happy

Crumbs. The code is substantially LONGER than before. Why?

Still, it is at least modularly separated.

Crumbs. The code is substantially LONGER than before. Why?

Still, it is at least modularly separated.

There aren't any fundamental changes, but there are a lot more comments/definitions to clarify what's going on and I've stuck more rigidly to the 80-character restriction. I can condense it a bit if you think that is preferable.

Don't worry, I'm just bleating. Go for it.

adamgundry updated this revision to Diff 4785.Oct 30 2015, 6:51 AM

Rebase on latest HEAD (with record pattern synonyms), separate from OverloadedLabels

  • Handle record selectors properly in Template Haskell
  • Refactor disambiguateRecordBinds and make errors more uniform
  • Handle non-fields appearing in updates
  • More refactoring and fixing of comments
  • Refactor to make lint happy
  • Merge remote-tracking branch 'origin/master' into wip/duplicate-record-fields-selector-disambiguation
adamgundry updated this revision to Diff 4786.Oct 30 2015, 7:52 AM

Resolve conflict with Simon's lovely addUsedGRE changes

  • Merge remote-tracking branch 'origin/master' into wip/duplicate-record-fields-selector-disambiguation
This revision was automatically updated to reflect the committed changes.