#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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to