[commit: ghc] wip/rae: Test #9318 in typecheck/should_fail/T9318 (908d540)

git at git.haskell.org git at git.haskell.org
Tue Nov 18 20:22:09 UTC 2014


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

On branch  : wip/rae
Link       : http://ghc.haskell.org/trac/ghc/changeset/908d5404cc781fde0efef1c1e2f4b7b0891f677f/ghc

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

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

    Test #9318 in typecheck/should_fail/T9318


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

908d5404cc781fde0efef1c1e2f4b7b0891f677f
 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