Skip to content
  • Ryan Scott's avatar
    Fix deriveTyData's kind unification when two kind variables are unified · e53f2180
    Ryan Scott authored
    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
    e53f2180