[commit: ghc] master: Fix DeriveGeneric for types with same OccName (#10487) (b08a533d)

git at git.haskell.org git at git.haskell.org
Thu Sep 24 07:50:34 UTC 2015


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

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

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

commit b08a533dc87423a75bce037eb403d7828d3330d3
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date:   Thu Sep 24 00:51:19 2015 -0700

    Fix DeriveGeneric for types with same OccName (#10487)
    
    Summary:
    DeriveGeneric generates some data types (for data type constructors and for
    selectors of those constructors) and instances for those types. This patch
    changes name generation for these new types to make it working with data types
    with same names imported from different modules and with data types with same
    names imported from same modules(using module imports).
    
    Bonus content:
    
    - Some refactoring in `TcGenGenerics.metaTyConsToDerivStuff` to remove some
      redundant partial function applications and to remove a duplicated function.
    - Remove some unused names from `OccName`. (those were used for an old
      implementation of `DeriveGeneric`)
    
    Reviewers: kosmikus, simonpj, dreixel, ezyang, bgamari, austin
    
    Reviewed By: bgamari, austin
    
    Subscribers: ezyang, thomie
    
    Differential Revision: https://phabricator.haskell.org/D1081
    
    GHC Trac Issues: #10487


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

b08a533dc87423a75bce037eb403d7828d3330d3
 compiler/basicTypes/OccName.hs                     |  37 ++--
 compiler/typecheck/TcDeriv.hs                      |  27 ++-
 compiler/typecheck/TcEnv.hs                        |  20 ++-
 compiler/typecheck/TcGenGenerics.hs                |  52 +++---
 testsuite/tests/deriving/should_compile/T10487.hs  |  12 ++
 .../tests/deriving/should_compile/T10487_M.hs      |   3 +
 testsuite/tests/deriving/should_compile/all.T      |   2 +-
 testsuite/tests/generics/GenDerivOutput.stderr     |  80 +++++----
 testsuite/tests/generics/GenDerivOutput1_0.stderr  |  36 ++--
 testsuite/tests/generics/GenDerivOutput1_1.stderr  | 192 ++++++++++++---------
 10 files changed, 270 insertions(+), 191 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 b08a533dc87423a75bce037eb403d7828d3330d3


More information about the ghc-commits mailing list