#5769: Incorrect 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 trying to compile

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

 convert :: a -> b
 convert = undefined

 type family Foo a

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

 I get the following error message:
 {{{
 Sandbox.hs:12:10:
     Couldn't match type `Foo k a' with `Foo * b'
     NB: `Foo' is a type function, and may not be injective
     In the expression: (convert f :: Foo a)
     In an equation for `bar': bar f = (convert f :: Foo a)
 }}}

 However, this compiles just fine without {{{PolyKinds}}}.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5769>
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