[GHC] #7938: Unbound kind variable can appear in RHS of associated type

#7938: Unbound kind variable can appear in RHS of associated type ----------------------------------------+----------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.6.3 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: GHC accepts invalid program | Blockedby: Blocking: | Related: ----------------------------------------+----------------------------------- Consider the following code: {{{ {-# LANGUAGE TypeFamilies, PolyKinds, MultiParamTypeClasses, FlexibleInstances, DataKinds #-} data KProxy (a :: *) = KP class Foo (a :: k1) (b :: k2) where type Bar a instance Foo (a :: k1) (b :: k2) where type Bar a = (KP :: KProxy k2) }}} The kind variable {{{k2}}} appears on the RHS of the instance for {{{Bar}}} but not on the left-hand side. This is disallowed for type variables, but there seems to be no check for kind variables. I will fix in an upcoming patch. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7938 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC