[GHC] #11837: GHC fails to unify kinds when deriving polykinded typeclass instance for polykinded newtype
GHC
ghc-devs at haskell.org
Thu May 12 13:39:49 UTC 2016
#11837: GHC fails to unify kinds when deriving polykinded typeclass instance for
polykinded newtype
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: RyanGlScott
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler (Type | Version: 8.0.1
checker) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC rejects | Unknown/Multiple
valid program | Test Case:
Blocked By: | Blocking:
Related Tickets: #8865, #11833 | Differential Rev(s): Phab:D2117
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari <ben@…>):
In [changeset:"e53f2180e89652c72e51ffa614c56294ba67cf37/ghc"
e53f2180/ghc]:
{{{
#!CommitTicketReference repository="ghc"
revision="e53f2180e89652c72e51ffa614c56294ba67cf37"
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
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11837#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list