[commit: testsuite] master: Test Trac #7276 (part 2) (a55ea87)

Simon Peyton Jones <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
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 <[email protected]>
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'])
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.