summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2011-09-29 16:55:58 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2011-09-29 16:55:58 +0100
commitb34aa2cdcab4b797d0439eaca74f974814d50586 (patch)
treefc65f14533c4cbddddd348d30c17218b90cd0603
parent50029f694b4d96c50db9528cb48ea25659997d56 (diff)
downloadhaskell-b34aa2cdcab4b797d0439eaca74f974814d50586.tar.gz
Test Trac #5508
-rw-r--r--testsuite/tests/th/T5508.hs9
-rw-r--r--testsuite/tests/th/T5508.stderr6
-rw-r--r--testsuite/tests/th/all.T1
3 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/th/T5508.hs b/testsuite/tests/th/T5508.hs
new file mode 100644
index 0000000000..ee82e8ff9b
--- /dev/null
+++ b/testsuite/tests/th/T5508.hs
@@ -0,0 +1,9 @@
+{-# LANGUAGE TemplateHaskell #-}
+
+module T5508 where
+
+import Language.Haskell.TH
+
+thb = $(do { let x = mkName "x"
+ v = return (LamE [VarP x] $ VarE x)
+ ; [| $v . id |] })
diff --git a/testsuite/tests/th/T5508.stderr b/testsuite/tests/th/T5508.stderr
new file mode 100644
index 0000000000..ff0383da7a
--- /dev/null
+++ b/testsuite/tests/th/T5508.stderr
@@ -0,0 +1,6 @@
+T5508.hs:(7,9)-(9,28): Splicing expression
+ do { let x = mkName "x"
+ v = return (LamE [VarP x] $ VarE x);
+ [| $v . id |] }
+ ======>
+ ((\ x -> x) . id)
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index 9d588eb07e..1adf313227 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -207,3 +207,4 @@ test('TH_lookupName',
test('T5452', normal, compile, ['-v0'])
test('T5434', extra_clean(['T5434a.hi','T5434a.o']),
multimod_compile, ['T5434','-v0 -Wall'])
+test('T5508', normal, compile, ['-v0 -ddump-splices'])