[commit: ghc] master: Fix deriveTyData's kind unification when two kind variables are unified (e53f218)

git at git.haskell.org git at git.haskell.org
Thu May 12 13:39:59 UTC 2016


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

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

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

commit e53f2180e89652c72e51ffa614c56294ba67cf37
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


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

e53f2180e89652c72e51ffa614c56294ba67cf37
 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 e53f2180e89652c72e51ffa614c56294ba67cf37


More information about the ghc-commits mailing list