Test Trac #7276
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 3 Oct 2012 07:56:52 +0000 (08:56 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 3 Oct 2012 07:56:52 +0000 (08:56 +0100)
testsuite/tests/th/T7276.hs [new file with mode: 0644]
testsuite/tests/th/T7276.stderr [new file with mode: 0644]
testsuite/tests/th/all.T

diff --git a/testsuite/tests/th/T7276.hs b/testsuite/tests/th/T7276.hs
new file mode 100644 (file)
index 0000000..59a9ec0
--- /dev/null
@@ -0,0 +1,6 @@
+{-# OPTIONS_GHC -fdefer-type-errors #-}
+{-# LANGUAGE TemplateHaskell #-}
+
+module T7276 where
+
+x = $( [d| y = 3 |] )
diff --git a/testsuite/tests/th/T7276.stderr b/testsuite/tests/th/T7276.stderr
new file mode 100644 (file)
index 0000000..aeb3664
--- /dev/null
@@ -0,0 +1,9 @@
+
+T7276.hs:6:8:
+    Couldn't match type `[Language.Haskell.TH.Syntax.Dec]'
+                  with `Language.Haskell.TH.Syntax.Exp'
+    Expected type: Language.Haskell.TH.Lib.ExpQ
+      Actual type: Language.Haskell.TH.Lib.DecsQ
+    In the Template Haskell quotation [d| y = 3 |]
+    In the expression: [d| y = 3 |]
+    In the expression: $([d| y = 3 |])
index 46cdc59..6e332e2 100644 (file)
@@ -252,3 +252,4 @@ test('T7064',
      ['T7064.hs', '-v0'])
 test('T7092', extra_clean(['T7092a.hi','T7092a.o']),
               multimod_compile, ['T7092','-v0'])
+test('T7276', normal, compile_fail, ['-v0'])