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

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/a55ea871e882599921023005ce94448af103f3cf

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

commit a55ea871e882599921023005ce94448af103f3cf
Author: Simon Peyton Jones <simo...@microsoft.com>
Date:   Fri Oct 26 16:38:46 2012 +0100

    Test Trac #7276 (part 2)

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

 tests/th/T7276a.script |    4 ++++
 tests/th/T7276a.stdout |   21 +++++++++++++++++++++
 tests/th/all.T         |    1 +
 3 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/tests/th/T7276a.script b/tests/th/T7276a.script
new file mode 100644
index 0000000..5ebd911
--- /dev/null
+++ b/tests/th/T7276a.script
@@ -0,0 +1,4 @@
+:set -XTemplateHaskell -fdefer-type-errors
+import Language.Haskell.TH
+let x = [d|a = ()|] :: Q Exp
+:t $x
diff --git a/tests/th/T7276a.stdout b/tests/th/T7276a.stdout
new file mode 100644
index 0000000..8c4f7af
--- /dev/null
+++ b/tests/th/T7276a.stdout
@@ -0,0 +1,21 @@
+
+<interactive>:4:9: Warning:
+    Couldn't match type `[Dec]' with `Exp'
+    Expected type: Q Exp
+      Actual type: DecsQ
+    In the Template Haskell quotation [d| a = () |]
+    In the expression: [d| a = () |] :: Q Exp
+    In an equation for `x': x = [d| a = () |] :: Q Exp
+
+<interactive>:1:1:
+    Exception when trying to run compile-time code:
+      <interactive>:4:9:
+    Couldn't match type `[Dec]' with `Exp'
+    Expected type: Q Exp
+      Actual type: DecsQ
+    In the Template Haskell quotation [d| a = () |]
+    In the expression: [d| a = () |] :: Q Exp
+    In an equation for `x': x = [d| a = () |] :: Q Exp
+(deferred type error)
+    Code: x
+    In the expression: $x
diff --git a/tests/th/all.T b/tests/th/all.T
index 6e332e2..d74bbea 100644
--- a/tests/th/all.T
+++ b/tests/th/all.T
@@ -253,3 +253,4 @@ test('T7064',
 test('T7092', extra_clean(['T7092a.hi','T7092a.o']),
               multimod_compile, ['T7092','-v0'])
 test('T7276', normal, compile_fail, ['-v0'])
+test('T7276a', combined_output, ghci_script, ['T7276a.script'])



_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to