summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Bollmann <bollmann@seas.upenn.edu>2016-03-11 10:38:28 +0100
committerBen Gamari <ben@smart-cactus.org>2016-03-11 13:20:17 +0100
commitf3def7643d390db54d18b8c3d385c490fba58a41 (patch)
treefb5a68d1b928a32053181ef385e85b1e3d923f45
parent30ee9102db2f16894912e19b9d16156824611bbb (diff)
downloadhaskell-f3def7643d390db54d18b8c3d385c490fba58a41.tar.gz
add regression test for #11145.
The original TH failure observed by the ticket, namely that Template Haskell quotes of data instance GADTs are broken, is not observable anymore in HEAD. I therefore just added the corresponding regression test. Test Plan: ./validate Reviewers: goldfire, austin, thomie, jstolarek, bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D1978 GHC Trac Issues: #11145
-rw-r--r--testsuite/tests/th/T11145.hs9
-rw-r--r--testsuite/tests/th/T11145.stderr8
-rw-r--r--testsuite/tests/th/all.T1
3 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/th/T11145.hs b/testsuite/tests/th/T11145.hs
new file mode 100644
index 0000000000..f3968e99e1
--- /dev/null
+++ b/testsuite/tests/th/T11145.hs
@@ -0,0 +1,9 @@
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE TemplateHaskell #-}
+module T11145 where
+
+data family Fuggle x y
+
+[d| data instance Fuggle Int (Maybe (a,b)) where
+ MkFuggle :: Fuggle Int (Maybe Bool) |]
diff --git a/testsuite/tests/th/T11145.stderr b/testsuite/tests/th/T11145.stderr
new file mode 100644
index 0000000000..98e518cbbf
--- /dev/null
+++ b/testsuite/tests/th/T11145.stderr
@@ -0,0 +1,8 @@
+
+T11145.hs:8:1: error:
+ • Data constructor ‘MkFuggle’ returns type ‘Fuggle
+ Int (Maybe Bool)’
+ instead of an instance of its parent type ‘Fuggle
+ Int (Maybe (a_a4MU, b_a4MV))’
+ • In the definition of data constructor ‘MkFuggle’
+ In the data instance declaration for ‘Fuggle’
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index c39136bc94..7e9f25dc59 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -396,3 +396,4 @@ test('TH_finalizer', normal, compile, ['-v0'])
test('T10603', normal, compile, ['-ddump-splices -dsuppress-uniques'])
test('T11452', normal, compile_fail, ['-v0'])
test('T9022', normal, compile_and_run, ['-v0'])
+test('T11145', normal, compile_fail, ['-v0']) \ No newline at end of file