#5379: Scoping error in Template Haskell antiquotations
---------------------------------+------------------------------------------
    Reporter:  reinerp           |       Owner:              
        Type:  bug               |      Status:  new         
    Priority:  normal            |   Component:  Compiler    
     Version:  7.0.4             |    Keywords:              
    Testcase:                    |   Blockedby:              
          Os:  Unknown/Multiple  |    Blocking:              
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
---------------------------------+------------------------------------------
 Related to #5375, #5037. When compiling and running the following:

 {{{
 {-# LANGUAGE TemplateHaskell #-}

 import Language.Haskell.TH

 $( [d| g = 0
        h = $( return $ LamE [VarP (mkName "g")] (VarE 'g) ) |] )

 main = print (h 1)
 }}}

 the splice should be

 {{{
 g' = 0
 h = \g -> g'
 }}}

 and so the program should print 0 at runtime. Instead, it prints 1.

 This is with both ghc-7.0.3 and ghc-7.3.20110803.

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