Ticket #5379 (closed bug: fixed)
Scoping error in Template Haskell antiquotations
Description
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.
Change History
Note: See
TracTickets for help on using
tickets.
