#5770: Non-sensical error message when compiling with PolyKinds and a type 
family
------------------------------+---------------------------------------------
 Reporter:  goldfire          |          Owner:                         
     Type:  bug               |         Status:  new                    
 Priority:  normal            |      Component:  Compiler (Type checker)
  Version:  7.4.1-rc1         |       Keywords:  PolyKinds              
       Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple       
  Failure:  None/Unknown      |       Testcase:                         
Blockedby:                    |       Blocking:                         
  Related:                    |  
------------------------------+---------------------------------------------
 When I compile the following code:

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

 convert :: a -> b
 convert = undefined

 type family Foo a
 type instance Foo Int = Bool

 bar :: forall a b c dummya. (b -> c) -> ((Foo a) -> c)
 bar f = (convert f :: (Foo a) -> c)
 }}}

 I get the following error message:

 {{{
 Sandbox.hs:13:34:
     Kind mis-match
     Expected kind `OpenKind', but `c' has kind `b'
     In an expression type signature: (Foo a) -> c
     In the expression: (convert f :: (Foo a) -> c)
     In an equation for `bar': bar f = (convert f :: (Foo a) -> c)
 }}}

 This error message does not make sense, for 'b' isn't a kind. It is
 interesting to note that removing {{{dummya}}} from the list of declared
 type variables changes the error to a GHC panic.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to