Test Trac #8577
authorSimon Peyton Jones <simonpj@microsoft.com>
Thu, 5 Dec 2013 08:34:22 +0000 (08:34 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 5 Dec 2013 08:34:22 +0000 (08:34 +0000)
testsuite/tests/th/T8577.hs [new file with mode: 0644]
testsuite/tests/th/T8577.stderr [new file with mode: 0644]
testsuite/tests/th/T8577a.hs [new file with mode: 0644]
testsuite/tests/th/all.T

diff --git a/testsuite/tests/th/T8577.hs b/testsuite/tests/th/T8577.hs
new file mode 100644 (file)
index 0000000..8a467e4
--- /dev/null
@@ -0,0 +1,10 @@
+{-# LANGUAGE TemplateHaskell #-}
+module T8577 where
+
+import Language.Haskell.TH
+
+import T8577a
+
+foo2 :: A Bool
+foo2 = $$(y)
+
diff --git a/testsuite/tests/th/T8577.stderr b/testsuite/tests/th/T8577.stderr
new file mode 100644 (file)
index 0000000..6e35e4a
--- /dev/null
@@ -0,0 +1,7 @@
+
+T8577.hs:9:11:
+    Couldn't match type ‛Int’ with ‛Bool’
+    Expected type: Q (TExp (A Bool))
+      Actual type: Q (TExp (A Int))
+    In the expression: y
+    In the Template Haskell splice $$y
diff --git a/testsuite/tests/th/T8577a.hs b/testsuite/tests/th/T8577a.hs
new file mode 100644 (file)
index 0000000..807350c
--- /dev/null
@@ -0,0 +1,11 @@
+{-# LANGUAGE TemplateHaskell #-}
+module T8577a where
+import Language.Haskell.TH
+
+data A a = A
+
+x :: Q (TExp (A a))
+x = [|| A ||]
+
+y :: Q (TExp (A Int))
+y = x
index a1fd6bf..05d5d90 100644 (file)
@@ -311,3 +311,7 @@ test('T8540',
      extra_clean(['T8540a.hi', 'T8540a.o']),
      multimod_compile,
      ['T8540', '-v0 ' + config.ghc_th_way_flags])
+test('T8577',
+     extra_clean(['T8577a.hi', 'T8577a.o']),
+     multimod_compile_fail,
+     ['T8577', '-v0 ' + config.ghc_th_way_flags])