[commit: ghc] master: add regression test for #11145. (f3def76)

git at git.haskell.org git at git.haskell.org
Fri Mar 11 12:27:14 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/f3def7643d390db54d18b8c3d385c490fba58a41/ghc

>---------------------------------------------------------------

commit f3def7643d390db54d18b8c3d385c490fba58a41
Author: Dominik Bollmann <bollmann at seas.upenn.edu>
Date:   Fri Mar 11 10:38:28 2016 +0100

    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


>---------------------------------------------------------------

f3def7643d390db54d18b8c3d385c490fba58a41
 testsuite/tests/th/T11145.hs     | 9 +++++++++
 testsuite/tests/th/T11145.stderr | 8 ++++++++
 testsuite/tests/th/all.T         | 1 +
 3 files changed, 18 insertions(+)

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



More information about the ghc-commits mailing list