[GHC] #9264: Scoped kind variables do not work with default associated types

GHC ghc-devs at haskell.org
Fri Jul 4 01:47:17 UTC 2014


#9264: Scoped kind variables do not work with default associated types
------------------------------------+-------------------------------------
       Reporter:  goldfire          |             Owner:
           Type:  bug               |            Status:  new
       Priority:  normal            |         Milestone:
      Component:  Compiler          |           Version:  7.8.2
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+-------------------------------------
 I have

 {{{
 {-# LANGUAGE PolyKinds, TypeFamilies, ScopedTypeVariables #-}

 module Bug where

 class C (a :: k) where
   type F (a :: k)
   type F (a :: k) = Int
 }}}

 Compiling gives me

 {{{
 Bug.hs:7:11:
     The signature specified kind ‘k1’, but ‘a’ has kind ‘k2’
     In the type ‘(a :: k)’
     In the type instance declaration for ‘F’
     In the class declaration for ‘C’
 }}}

 The error is on the line declaring the default associated type for `F`.
 This happens in both 7.8.2 and HEAD. Having !ScopedTypeVariables causes no
 change, but I put it in the example to emphasize that adding
 !ScopedTypeVariables is not the solution.

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


More information about the ghc-tickets mailing list