New tests for #8368.
authorRichard Eisenberg <eir@cis.upenn.edu>
Thu, 3 Oct 2013 14:22:27 +0000 (10:22 -0400)
committerKrzysztof Gogolewski <krz.gogolewski@gmail.com>
Thu, 3 Oct 2013 16:58:06 +0000 (18:58 +0200)
testsuite/tests/indexed-types/should_fail/T8368.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/T8368.stderr [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/T8368a.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/T8368a.stderr [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/all.T

diff --git a/testsuite/tests/indexed-types/should_fail/T8368.hs b/testsuite/tests/indexed-types/should_fail/T8368.hs
new file mode 100644 (file)
index 0000000..2e35e39
--- /dev/null
@@ -0,0 +1,10 @@
+{-# LANGUAGE TypeFamilies, GADTs #-}
+
+module T8368 where
+
+data Foo = Bar
+
+data family Fam a
+data instance Fam a where
+  MkFam :: Foo
+  
\ No newline at end of file
diff --git a/testsuite/tests/indexed-types/should_fail/T8368.stderr b/testsuite/tests/indexed-types/should_fail/T8368.stderr
new file mode 100644 (file)
index 0000000..b767489
--- /dev/null
@@ -0,0 +1,6 @@
+
+T8368.hs:9:3:
+    Data constructor ‛MkFam’ returns type ‛Foo’
+      instead of an instance of its parent type ‛Fam’
+    In the definition of data constructor ‛MkFam’
+    In the data instance declaration for ‛Fam’
diff --git a/testsuite/tests/indexed-types/should_fail/T8368a.hs b/testsuite/tests/indexed-types/should_fail/T8368a.hs
new file mode 100644 (file)
index 0000000..10def3c
--- /dev/null
@@ -0,0 +1,8 @@
+{-# LANGUAGE TypeFamilies, GADTs #-}
+
+module T8368a where
+
+data family Fam a b
+data instance Fam Int b where
+  MkFam :: Fam Bool b
+  
\ No newline at end of file
diff --git a/testsuite/tests/indexed-types/should_fail/T8368a.stderr b/testsuite/tests/indexed-types/should_fail/T8368a.stderr
new file mode 100644 (file)
index 0000000..247a633
--- /dev/null
@@ -0,0 +1,6 @@
+
+T8368a.hs:7:3:
+    Data constructor ‛MkFam’ returns type ‛Fam Bool b’
+      instead of an instance of its parent type ‛Fam Int b’
+    In the definition of data constructor ‛MkFam’
+    In the data instance declaration for ‛Fam’
index 36872a3..6223bde 100644 (file)
@@ -116,3 +116,5 @@ test('T8129',
      run_command,
      ['$MAKE -s --no-print-directory T8129'])
 
+test('T8368', normal, compile_fail, [''])
+test('T8368a', normal, compile_fail, [''])
\ No newline at end of file