[commit: ghc] master: Test #8044 in typecheck/should_fail/T8044 (8459404)

git at git.haskell.org git at git.haskell.org
Mon Nov 24 20:25:59 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/8459404b6431e44669f8732b6787c7d6b67b984b/ghc

>---------------------------------------------------------------

commit 8459404b6431e44669f8732b6787c7d6b67b984b
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Mon Nov 24 15:17:15 2014 -0500

    Test #8044 in typecheck/should_fail/T8044


>---------------------------------------------------------------

8459404b6431e44669f8732b6787c7d6b67b984b
 testsuite/tests/typecheck/should_fail/T8044.hs     | 16 ++++++++++++++++
 testsuite/tests/typecheck/should_fail/T8044.stderr |  9 +++++++++
 testsuite/tests/typecheck/should_fail/all.T        |  1 +
 3 files changed, 26 insertions(+)

diff --git a/testsuite/tests/typecheck/should_fail/T8044.hs b/testsuite/tests/typecheck/should_fail/T8044.hs
new file mode 100644
index 0000000..0a1ce69
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T8044.hs
@@ -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
index 0000000..6178ea3
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T8044.stderr
@@ -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
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 81ea3d2..05f77bb 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -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, [''])



More information about the ghc-commits mailing list