Test #8044 in typecheck/should_fail/T8044
authorRichard Eisenberg <eir@cis.upenn.edu>
Mon, 24 Nov 2014 20:17:15 +0000 (15:17 -0500)
committerRichard Eisenberg <eir@cis.upenn.edu>
Mon, 24 Nov 2014 20:26:29 +0000 (15:26 -0500)
testsuite/tests/typecheck/should_fail/T8044.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T8044.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T

diff --git a/testsuite/tests/typecheck/should_fail/T8044.hs b/testsuite/tests/typecheck/should_fail/T8044.hs
new file mode 100644 (file)
index 0000000..0a1ce69
--- /dev/null
@@ -0,0 +1,16 @@
+{-# LANGUAGE GADTs, TypeFamilies #-}
+
+module T8044 where
+
+data X a where
+  XInt :: X Int
+  XBool :: X Bool
+  XChar :: X Char
+
+type family Frob a where
+  Frob Int = Int
+  Frob x   = Char
+
+frob :: X a -> X (Frob a)
+frob XInt = XInt
+frob _    = XChar
diff --git a/testsuite/tests/typecheck/should_fail/T8044.stderr b/testsuite/tests/typecheck/should_fail/T8044.stderr
new file mode 100644 (file)
index 0000000..6178ea3
--- /dev/null
@@ -0,0 +1,9 @@
+
+T8044.hs:16:13:
+    Couldn't match type ‘Frob a’ with ‘Char’
+    Expected type: X (Frob a)
+      Actual type: X Char
+    Relevant bindings include
+      frob :: X a -> X (Frob a) (bound at T8044.hs:15:1)
+    In the expression: XChar
+    In an equation for ‘frob’: frob _ = XChar
index 81ea3d2..05f77bb 100644 (file)
@@ -344,3 +344,4 @@ test('T9318', normal, compile_fail, [''])
 test('T9201', normal, compile_fail, [''])
 test('T9109', normal, compile_fail, [''])
 test('T9497d', normal, compile_fail, ['-fdefer-type-errors -fno-defer-typed-holes'])
+test('T8044', normal, compile_fail, [''])