add regression test for #11145.
authorDominik Bollmann <bollmann@seas.upenn.edu>
Fri, 11 Mar 2016 09:38:28 +0000 (10:38 +0100)
committerBen Gamari <ben@smart-cactus.org>
Fri, 11 Mar 2016 12:20:17 +0000 (13:20 +0100)
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

testsuite/tests/th/T11145.hs [new file with mode: 0644]
testsuite/tests/th/T11145.stderr [new file with mode: 0644]
testsuite/tests/th/all.T

diff --git a/testsuite/tests/th/T11145.hs b/testsuite/tests/th/T11145.hs
new file mode 100644 (file)
index 0000000..f3968e9
--- /dev/null
@@ -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 (file)
index 0000000..98e518c
--- /dev/null
@@ -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’
index c39136b..7e9f25d 100644 (file)
@@ -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