#6065: Suggested type signature causes a type error (even though it appears
correct)
---------------------------------------+------------------------------------
 Reporter:  tvynr                      |          Owner:                        
                  
     Type:  bug                        |         Status:  new                   
                  
 Priority:  normal                     |      Component:  Compiler (Type 
checker)                 
  Version:  7.4.1                      |       Keywords:  type signature 
typeclass instance forall
       Os:  Linux                      |   Architecture:  x86_64 (amd64)        
                  
  Failure:  GHC rejects valid program  |       Testcase:                        
                  
Blockedby:                             |       Blocking:                        
                  
  Related:                             |  
---------------------------------------+------------------------------------

Comment(by guest):

 I reduced your test case. The following file compiles, but if inferred
 type signature to "upcast" is added, it doesn't.

 {{{
 {-# LANGUAGE MultiParamTypeClasses, FlexibleContexts, FlexibleInstances
 #-}

 class AstOp ast result where
   astop :: ast -> result

 -- upcast :: AstOp ast ((ast -> t) -> t) => ast -> t
 upcast ast = astop ast upcast
 }}}

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