[commit: ghc] master: Reify DuplicateRecordFields by label, rather than by selector (4b161c9)

git at git.haskell.org git at git.haskell.org
Thu Dec 17 11:54:34 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/4b161c93dba774cc8051cf40a2024ad86f3259f2/ghc

>---------------------------------------------------------------

commit 4b161c93dba774cc8051cf40a2024ad86f3259f2
Author: Adam Gundry <adam at well-typed.com>
Date:   Thu Dec 17 12:19:23 2015 +0100

    Reify DuplicateRecordFields by label, rather than by selector
    
    See `Note [Reifying field labels]` in `TcSplice`. This makes
    typical uses of TH work better with `DuplicateRecordFields`.
    If `reify` is called on the `Name` of a field label produced by
    the output of a previous `reify`, and there are multiple  fields
    with that label defined in the same module, it may fail with
    an ambiguity error.
    
    Test Plan:
    Added tests, and manually tested that this makes
    Aeson's `deriveJSON` avoid the `$sel:` prefixes.
    
    Reviewers: simonpj, goldfire, austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1586
    
    GHC Trac Issues: #11103


>---------------------------------------------------------------

4b161c93dba774cc8051cf40a2024ad86f3259f2
 compiler/typecheck/TcSplice.hs                     | 51 +++++++++++++++++++++-
 .../tests/overloadedrecflds/should_fail/T11103.hs  | 20 +++++++++
 .../overloadedrecflds/should_fail/T11103.stderr    |  6 +++
 .../tests/overloadedrecflds/should_fail/all.T      |  1 +
 .../should_run/overloadedrecfldsrun04.hs           | 15 ++++++-
 .../should_run/overloadedrecfldsrun04.stdout       |  5 ++-
 6 files changed, 95 insertions(+), 3 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 4b161c93dba774cc8051cf40a2024ad86f3259f2


More information about the ghc-commits mailing list