[commit: testsuite] master: Test Trac #8577 (3e66489)
git at git.haskell.org
git at git.haskell.org
Thu Dec 5 08:34:33 UTC 2013
Repository : ssh://git@git.haskell.org/testsuite
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/3e66489ebcef0f4cd86968c6781a1d4ad1981f94/testsuite
>---------------------------------------------------------------
commit 3e66489ebcef0f4cd86968c6781a1d4ad1981f94
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Thu Dec 5 08:34:22 2013 +0000
Test Trac #8577
>---------------------------------------------------------------
3e66489ebcef0f4cd86968c6781a1d4ad1981f94
tests/th/T8577.hs | 10 ++++++++++
tests/th/T8577.stderr | 7 +++++++
tests/th/T8577a.hs | 11 +++++++++++
tests/th/all.T | 4 ++++
4 files changed, 32 insertions(+)
diff --git a/tests/th/T8577.hs b/tests/th/T8577.hs
new file mode 100644
index 0000000..8a467e4
--- /dev/null
+++ b/tests/th/T8577.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE TemplateHaskell #-}
+module T8577 where
+
+import Language.Haskell.TH
+
+import T8577a
+
+foo2 :: A Bool
+foo2 = $$(y)
+
diff --git a/tests/th/T8577.stderr b/tests/th/T8577.stderr
new file mode 100644
index 0000000..6e35e4a
--- /dev/null
+++ b/tests/th/T8577.stderr
@@ -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/tests/th/T8577a.hs b/tests/th/T8577a.hs
new file mode 100644
index 0000000..807350c
--- /dev/null
+++ b/tests/th/T8577a.hs
@@ -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
diff --git a/tests/th/all.T b/tests/th/all.T
index a1fd6bf..05d5d90 100644
--- a/tests/th/all.T
+++ b/tests/th/all.T
@@ -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])
More information about the ghc-commits
mailing list