[commit: testsuite] no-pred-ty: Test type families in instance/class heads (63abb11)
Max Bolingbroke
batterseapower at hotmail.com
Sun Sep 4 13:54:32 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite
On branch : no-pred-ty
http://hackage.haskell.org/trac/ghc/changeset/63abb11ec2137e2fcb4f4cc2891012768fa51deb
>---------------------------------------------------------------
commit 63abb11ec2137e2fcb4f4cc2891012768fa51deb
Author: Max Bolingbroke <batterseapower at hotmail.com>
Date: Sat Sep 3 10:43:09 2011 +0100
Test type families in instance/class heads
>---------------------------------------------------------------
tests/typecheck/should_fail/all.T | 2 ++
tests/typecheck/should_fail/tcfail213.hs | 6 ++++++
.../{tcfail091.stderr => tcfail213.stderr} | 6 +++---
tests/typecheck/should_fail/tcfail214.hs | 7 +++++++
tests/typecheck/should_fail/tcfail214.stderr | 6 ++++++
5 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/tests/typecheck/should_fail/all.T b/tests/typecheck/should_fail/all.T
index 47c2ede..0b13100 100644
--- a/tests/typecheck/should_fail/all.T
+++ b/tests/typecheck/should_fail/all.T
@@ -241,6 +241,8 @@ test('tcfail209', normal, compile_fail, [''])
test('tcfail210', normal, compile_fail, [''])
test('tcfail211', normal, compile_fail, [''])
test('tcfail212', normal, compile_fail, [''])
+test('tcfail213', normal, compile_fail, [''])
+test('tcfail214', normal, compile_fail, [''])
test('FailDueToGivenOverlapping', normal, compile_fail, [''])
test('LongWayOverlapping', normal, compile_fail, [''])
diff --git a/tests/typecheck/should_fail/tcfail213.hs b/tests/typecheck/should_fail/tcfail213.hs
new file mode 100644
index 0000000..133418a
--- /dev/null
+++ b/tests/typecheck/should_fail/tcfail213.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE TypeFamilies, ConstraintKind #-}
+module ShouldFail where
+
+type family F a :: Constraint
+
+class (F a) => C a where
diff --git a/tests/typecheck/should_fail/tcfail091.stderr b/tests/typecheck/should_fail/tcfail213.stderr
similarity index 51%
copy from tests/typecheck/should_fail/tcfail091.stderr
copy to tests/typecheck/should_fail/tcfail213.stderr
index 74ca90b..11f24de 100644
--- a/tests/typecheck/should_fail/tcfail091.stderr
+++ b/tests/typecheck/should_fail/tcfail213.stderr
@@ -1,6 +1,6 @@
-tcfail091.hs:8:1:
- Illegal constraint ?imp::Int
- In the context: (?imp::Int)
+tcfail213.hs:6:1:
+ Illegal constraint F a
+ In the context: (F a)
While checking the super-classes of class `C'
In the class declaration for `C'
diff --git a/tests/typecheck/should_fail/tcfail214.hs b/tests/typecheck/should_fail/tcfail214.hs
new file mode 100644
index 0000000..718810a
--- /dev/null
+++ b/tests/typecheck/should_fail/tcfail214.hs
@@ -0,0 +1,7 @@
+{-# LANGUAGE TypeFamilies, ConstraintKind #-}
+module ShouldFail where
+
+type family F a :: Constraint
+
+class C a where
+instance (F a) => C [a] where
diff --git a/tests/typecheck/should_fail/tcfail214.stderr b/tests/typecheck/should_fail/tcfail214.stderr
new file mode 100644
index 0000000..d83fe24
--- /dev/null
+++ b/tests/typecheck/should_fail/tcfail214.stderr
@@ -0,0 +1,6 @@
+
+tcfail214.hs:7:10:
+ Illegal constraint F a
+ In the context: (F a)
+ While checking the context of an instance declaration
+ In the instance declaration for `C [a]'
More information about the Cvs-ghc
mailing list