summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2011-08-05 16:28:57 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2011-08-05 16:28:57 +0100
commitfa3fb70d796ce3c17a84b7b9ed3a7ce9531a82d7 (patch)
tree927a2ed02ee16427f219219589373bb19ebbbf6b
parentf53c388164540b83b1eaaab4354f362dc55ceb95 (diff)
downloadhaskell-fa3fb70d796ce3c17a84b7b9ed3a7ce9531a82d7.tar.gz
Test Trac #5379
-rw-r--r--testsuite/tests/th/T5379.hs11
-rw-r--r--testsuite/tests/th/T5379.stdout1
-rw-r--r--testsuite/tests/th/all.T1
3 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/th/T5379.hs b/testsuite/tests/th/T5379.hs
new file mode 100644
index 0000000000..d978032534
--- /dev/null
+++ b/testsuite/tests/th/T5379.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE TemplateHaskell #-}
+module Main where
+
+import Language.Haskell.TH
+
+$( [d| g = 0
+ h = $( return $ LamE [VarP (mkName "g")] (VarE 'g) ) |] )
+ -- The 'g should bind to the g=0 definition
+
+-- Should print 0, not 1!
+main = print (h 1)
diff --git a/testsuite/tests/th/T5379.stdout b/testsuite/tests/th/T5379.stdout
new file mode 100644
index 0000000000..573541ac97
--- /dev/null
+++ b/testsuite/tests/th/T5379.stdout
@@ -0,0 +1 @@
+0
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index f2abff4e3d..f69a9ab9dd 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -195,3 +195,4 @@ test('TH_unresolvedInfix2',
['-v0'])
test('T5358', normal, compile_fail, [''])
+test('T5379', normal, compile_and_run, [''])