[GHC] #6065: Suggested type signature causes a type error (even though it appears correct)

GHC cvs-ghc at haskell.org
Tue Jun 5 14:39:22 CEST 2012


#6065: Suggested type signature causes a type error (even though it appears
correct)
---------------------------------------------------------+------------------
    Reporter:  tvynr                                     |       Owner:                           
        Type:  bug                                       |      Status:  new                      
    Priority:  normal                                    |   Milestone:  _|_                      
   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
  Difficulty:  Unknown                                   |    Testcase:                           
   Blockedby:                                            |    Blocking:                           
     Related:                                            |  
---------------------------------------------------------+------------------

Comment(by simonpj):

 Type variables only scope if you have an explicit `forall`.  So you need
 {{{
 upcast :: forall ast1 ast2. (AstOp HomOp ast1 ((ast1 -> ast2) -> ast2)) =>
 ast1 -> ast2
 }}}
 That compiles fine.

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



More information about the Glasgow-haskell-bugs mailing list