#7341: Kind inference does not propagate annotations on associated types
------------------------------+---------------------------------------------
 Reporter:  goldfire          |          Owner:                  
     Type:  bug               |         Status:  new             
 Priority:  normal            |      Component:  Compiler        
  Version:  7.7               |       Keywords:  PolyKinds       
       Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
  Failure:  None/Unknown      |       Testcase:                  
Blockedby:                    |       Blocking:                  
  Related:                    |  
------------------------------+---------------------------------------------
 Consider the following:

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

 data Proxy a = Proxy

 class C a where
   type F (a :: *) :: *
   op :: Proxy a -> Int

 instance C [] where
   op _ = 5
 }}}

 When compiled, this code generates a warning saying that {{{F []}}} is
 undefined. That's a good warning, but the problem is that the code is
 erroneous and should not compile. The problem is that the kind annotation
 on {{{a}}} in the declaration of the family {{{F}}} says that {{{a}}}
 should have kind {{{*}}}. However, I am permitted to write an instance for
 {{{[]}}}, which does not have kind {{{*}}}.

 After playing around with this, I was unable to find a way to cause a type
 safety error, but the behavior should probably be fixed.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to