Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/6fc962c1d819d6883c36349e1510c092719c687a

>---------------------------------------------------------------

commit 6fc962c1d819d6883c36349e1510c092719c687a
Author: Simon Peyton Jones <[email protected]>
Date:   Wed Mar 28 10:00:33 2012 +0100

    Test Trac #5971

>---------------------------------------------------------------

 tests/{cabal/cabal04/TH.hs => th/T5971.hs} |    4 ++--
 tests/th/T5971.stderr                      |    9 +++++++++
 tests/th/all.T                             |    1 +
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/tests/cabal/cabal04/TH.hs b/tests/th/T5971.hs
similarity index 50%
copy from tests/cabal/cabal04/TH.hs
copy to tests/th/T5971.hs
index 8719c7d..bca58ea 100644
--- a/tests/cabal/cabal04/TH.hs
+++ b/tests/th/T5971.hs
@@ -1,6 +1,6 @@
 {-# LANGUAGE TemplateHaskell #-}
-module TH where
+module T5971 where
 
 import Language.Haskell.TH
 
-spliceMe = [| (\xs -> tail xs ++ init xs) |]
+_ = $(newName "x" >>= varE)
diff --git a/tests/th/T5971.stderr b/tests/th/T5971.stderr
new file mode 100644
index 0000000..23e6b8d
--- /dev/null
+++ b/tests/th/T5971.stderr
@@ -0,0 +1,9 @@
+
+T5971.hs:6:7:
+    The exact Name `x' is not in scope
+      Probable cause: you used a unique name (NameU) in Template Haskell but 
did not bind it
+    In the result of the splice:
+      $(newName "x" >>= varE)
+    To see what the splice expanded to, use -ddump-splices
+    In the expression: $(newName "x" >>= varE)
+    In a pattern binding: _ = $(newName "x" >>= varE)
diff --git a/tests/th/all.T b/tests/th/all.T
index e692d28..42ebb5b 100644
--- a/tests/th/all.T
+++ b/tests/th/all.T
@@ -226,4 +226,5 @@ test('T5882', normal, compile, ['-v0'])
 test('T5886', extra_clean(['T5886a.hi','T5886a.o']), 
               multimod_compile, ['T5886','-v0'])
 test('T4135', normal, compile, ['-v0'])
+test('T5971', normal, compile_fail, ['-v0 -dsuppress-uniques'])
 



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to