[commit: ghc] ghc-8.0: Fix deriveTyData's kind unification when two kind variables are unified (ee4c583)

git at git.haskell.org git at git.haskell.org
Wed Aug 24 00:22:28 UTC 2016


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

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/ee4c5833b363bbea7a381766d4e11d5ff4737c22/ghc

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

commit ee4c5833b363bbea7a381766d4e11d5ff4737c22
Author: RyanGlScott <ryan.gl.scott at gmail.com>
Date:   Wed May 11 15:57:24 2016 +0200

    Fix deriveTyData's kind unification when two kind variables are unified
    
    When `deriveTyData` attempts to unify two kind variables (which can
    happen if both the typeclass and the datatype are poly-kinded), it
    mistakenly adds an extra mapping to its substitution which causes the
    unification to fail when applying the substitution. This can be
    prevented by checking both the domain and the range of the original
    substitution to see which kind variables shouldn't be put into the
    domain of the substitution. A more in-depth explanation is included in
    `Note [Unification of two kind variables in deriving]`.
    
    Fixes #11837.
    
    Test Plan: ./validate
    
    Reviewers: simonpj, hvr, goldfire, niteria, austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: niteria, thomie
    
    Differential Revision: https://phabricator.haskell.org/D2117
    
    GHC Trac Issues: #11837
    
    (cherry picked from commit e53f2180e89652c72e51ffa614c56294ba67cf37)


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

ee4c5833b363bbea7a381766d4e11d5ff4737c22
 compiler/typecheck/TcDeriv.hs                      | 60 ++++++++++++++++++++--
 compiler/types/TyCoRep.hs                          | 12 ++++-
 compiler/types/Type.hs                             |  2 +-
 .../should_compile/{T11833.hs => T11837.hs}        |  4 +-
 testsuite/tests/deriving/should_compile/all.T      |  1 +
 5 files changed, 70 insertions(+), 9 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 ee4c5833b363bbea7a381766d4e11d5ff4737c22


More information about the ghc-commits mailing list