Test Trac #14033
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 26 Jul 2017 10:30:55 +0000 (11:30 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 26 Jul 2017 11:33:49 +0000 (12:33 +0100)
testsuite/tests/indexed-types/should_fail/T14033.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/T14033.stderr [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/all.T

diff --git a/testsuite/tests/indexed-types/should_fail/T14033.hs b/testsuite/tests/indexed-types/should_fail/T14033.hs
new file mode 100644 (file)
index 0000000..2c8ab68
--- /dev/null
@@ -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 (file)
index 0000000..fbc6b54
--- /dev/null
@@ -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’
index 50257e6..8885933 100644 (file)
@@ -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, [''])