summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc221.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/tc221.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/tc221.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/tc221.hs b/testsuite/tests/typecheck/should_compile/tc221.hs
new file mode 100644
index 0000000000..903b2bc3ac
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/tc221.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE GADTs #-}
+
+-- A program very like this triggered a kind error with GHC 6.6
+
+module Foo where
+
+data PatchSeq p a b where
+ Nil :: PatchSeq p a b
+ U :: p a b -> PatchSeq p a b
+ (:-) :: PatchSeq p a b -> PatchSeq p b c -> PatchSeq p a c
+
+-- is_normal :: PatchSeq p a b -> Bool
+is_normal Nil = True
+is_normal (U _) = True
+is_normal (U _ :- _) = True
+is_normal _ = False