#6100: mistake in class inheritance system
----------------------------------+-----------------------------------------
    Reporter:  guest              |        Owner:                           
        Type:  bug                |       Status:  closed                   
    Priority:  normal             |    Component:  Compiler                 
     Version:  7.4.1              |   Resolution:  invalid                  
    Keywords:  class inheritance  |           Os:  Linux                    
Architecture:  x86                |      Failure:  GHC rejects valid program
    Testcase:                     |    Blockedby:                           
    Blocking:                     |      Related:                           
----------------------------------+-----------------------------------------
Changes (by kosmikus):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 No, GHC is correct.

 {{{
   func :: A a => a -> a -> Int
 }}}

 Note that both arguments have to have the *same* type. You have
 {{{
   f :: (A a, B b) => a -> b -> Int
 }}}

 While both arguments must be members of `A`, they don't have to be of the
 same concrete type. And that's exactly the error message you get, namely
 that GHC cannot deduce that `a` is equal to `b` (where `~` is GHC's way to
 denote type-level equality).

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