[commit: testsuite] master: New tests for #8368. (e3e28cd)
git at git.haskell.org
git
Thu Oct 3 20:03:40 UTC 2013
Repository : ssh://git at git.haskell.org/testsuite
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/e3e28cd65cea30a59e65a824b816f1a81ff46174/testsuite
>---------------------------------------------------------------
commit e3e28cd65cea30a59e65a824b816f1a81ff46174
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date: Thu Oct 3 10:22:27 2013 -0400
New tests for #8368.
>---------------------------------------------------------------
e3e28cd65cea30a59e65a824b816f1a81ff46174
tests/indexed-types/should_fail/T8368.hs | 10 ++++++++++
tests/indexed-types/should_fail/T8368.stderr | 6 ++++++
tests/indexed-types/should_fail/T8368a.hs | 8 ++++++++
tests/indexed-types/should_fail/T8368a.stderr | 6 ++++++
tests/indexed-types/should_fail/all.T | 2 ++
5 files changed, 32 insertions(+)
diff --git a/tests/indexed-types/should_fail/T8368.hs b/tests/indexed-types/should_fail/T8368.hs
new file mode 100644
index 0000000..2e35e39
--- /dev/null
+++ b/tests/indexed-types/should_fail/T8368.hs
@@ -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/tests/indexed-types/should_fail/T8368.stderr b/tests/indexed-types/should_fail/T8368.stderr
new file mode 100644
index 0000000..b767489
--- /dev/null
+++ b/tests/indexed-types/should_fail/T8368.stderr
@@ -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/tests/indexed-types/should_fail/T8368a.hs b/tests/indexed-types/should_fail/T8368a.hs
new file mode 100644
index 0000000..10def3c
--- /dev/null
+++ b/tests/indexed-types/should_fail/T8368a.hs
@@ -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/tests/indexed-types/should_fail/T8368a.stderr b/tests/indexed-types/should_fail/T8368a.stderr
new file mode 100644
index 0000000..247a633
--- /dev/null
+++ b/tests/indexed-types/should_fail/T8368a.stderr
@@ -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?
diff --git a/tests/indexed-types/should_fail/all.T b/tests/indexed-types/should_fail/all.T
index 36872a3..6223bde 100644
--- a/tests/indexed-types/should_fail/all.T
+++ b/tests/indexed-types/should_fail/all.T
@@ -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
More information about the ghc-commits
mailing list