[commit: ghc] master: Test #9318 in typecheck/should_fail/T9318 (5eebd99)

git at git.haskell.org git at git.haskell.org
Thu Nov 20 21:41:33 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/5eebd990ea7a5bc1937657b101ae83475e20fc7a/ghc

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

commit 5eebd990ea7a5bc1937657b101ae83475e20fc7a
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Tue Nov 18 13:16:01 2014 -0500

    Test #9318 in typecheck/should_fail/T9318


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

5eebd990ea7a5bc1937657b101ae83475e20fc7a
 testsuite/tests/typecheck/should_fail/T9318.hs     | 12 ++++++++++++
 testsuite/tests/typecheck/should_fail/T9318.stderr |  7 +++++++
 testsuite/tests/typecheck/should_fail/all.T        |  1 +
 3 files changed, 20 insertions(+)

diff --git a/testsuite/tests/typecheck/should_fail/T9318.hs b/testsuite/tests/typecheck/should_fail/T9318.hs
new file mode 100644
index 0000000..3110305
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T9318.hs
@@ -0,0 +1,12 @@
+{-# LANGUAGE TypeFamilies #-}
+
+module T9318 where
+
+type family F x
+type instance F Int = Bool
+
+foo :: F Int -> ()
+foo True = ()
+
+bar :: F Int -> ()
+bar 'x' = ()
diff --git a/testsuite/tests/typecheck/should_fail/T9318.stderr b/testsuite/tests/typecheck/should_fail/T9318.stderr
new file mode 100644
index 0000000..963d73e
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T9318.stderr
@@ -0,0 +1,7 @@
+
+T9318.hs:12:5:
+    Couldn't match type ‘Bool’ with ‘Char’
+    Expected type: F Int
+      Actual type: Char
+    In the pattern: 'x'
+    In an equation for ‘bar’: bar 'x' = ()
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 2b128dc..b6b5572 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -342,3 +342,4 @@ test('T9612', normal, compile_fail, [''])
 test('T9634', normal, compile_fail, [''])
 test('T9739', normal, compile_fail, [''])
 test('T9774', normal, compile_fail, [''])
+test('T9318', normal, compile_fail, [''])



More information about the ghc-commits mailing list