[GHC] #14331: Overzealous free-floating kind check causes deriving clause to be rejected

GHC ghc-devs at haskell.org
Fri Oct 13 16:18:20 UTC 2017


#14331: Overzealous free-floating kind check causes deriving clause to be rejected
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  merge
        Priority:  normal            |            Milestone:  8.2.2
       Component:  Compiler (Type    |              Version:  8.2.1
  checker)                           |
      Resolution:                    |             Keywords:  deriving
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  GHC rejects       |            Test Case:
  valid program                      |  deriving/should_compile/T14331
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Ah yes, you're right.   I was focusing on the `k`, but there's the `a` as
 well.

 But then I'd say that the error message is dead right.
 Let's put the implicit binders in:
 {{{
 data D {k1} (a::k1) = D deriving (forall k. C (a :: k))
 }}}
 Look at that!  `a` has kind `k1`; but in the `deriving` clause we claim
 that
 the occurrence of `a` ahs type `k`.  Boom.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14331#comment:16>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list