[commit: ghc] master: Test Trac #14033 (d31181b)

git at git.haskell.org git at git.haskell.org
Wed Jul 26 11:34:21 UTC 2017


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

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

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

commit d31181b90cff7c791465687377cd2093627df429
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Jul 26 11:30:55 2017 +0100

    Test Trac #14033


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

d31181b90cff7c791465687377cd2093627df429
 testsuite/tests/indexed-types/should_fail/T14033.hs     | 10 ++++++++++
 testsuite/tests/indexed-types/should_fail/T14033.stderr |  6 ++++++
 testsuite/tests/indexed-types/should_fail/all.T         |  1 +
 3 files changed, 17 insertions(+)

diff --git a/testsuite/tests/indexed-types/should_fail/T14033.hs b/testsuite/tests/indexed-types/should_fail/T14033.hs
new file mode 100644
index 0000000..2c8ab68
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T14033.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE TypeFamilies #-}
+
+module T14033 where
+
+newtype Zero = Zero
+newtype Succ a = Succ a
+
+type family Add n m :: * where
+     Add Zero m = m
+     Add (Succ n) m = Succ (Add n m)
diff --git a/testsuite/tests/indexed-types/should_fail/T14033.stderr b/testsuite/tests/indexed-types/should_fail/T14033.stderr
new file mode 100644
index 0000000..fbc6b54
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T14033.stderr
@@ -0,0 +1,6 @@
+
+T14033.hs:5:16: error:
+    • The constructor of a newtype must have exactly one field
+        but ‘Zero’ has none
+    • In the definition of data constructor ‘Zero’
+      In the newtype declaration for ‘Zero’
diff --git a/testsuite/tests/indexed-types/should_fail/all.T b/testsuite/tests/indexed-types/should_fail/all.T
index 50257e6..8885933 100644
--- a/testsuite/tests/indexed-types/should_fail/all.T
+++ b/testsuite/tests/indexed-types/should_fail/all.T
@@ -135,3 +135,4 @@ test('T7102a', normal, ghci_script, ['T7102a.script'])
 test('T13271', normal, compile_fail, [''])
 test('T13674', normal, compile_fail, [''])
 test('T13784', normal, compile_fail, [''])
+test('T14033', normal, compile_fail, [''])



More information about the ghc-commits mailing list