Test #9318 in typecheck/should_fail/T9318
authorRichard Eisenberg <eir@cis.upenn.edu>
Tue, 18 Nov 2014 18:16:01 +0000 (13:16 -0500)
committerRichard Eisenberg <eir@cis.upenn.edu>
Thu, 20 Nov 2014 20:27:28 +0000 (15:27 -0500)
testsuite/tests/typecheck/should_fail/T9318.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T9318.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T

diff --git a/testsuite/tests/typecheck/should_fail/T9318.hs b/testsuite/tests/typecheck/should_fail/T9318.hs
new file mode 100644 (file)
index 0000000..3110305
--- /dev/null
@@ -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 (file)
index 0000000..963d73e
--- /dev/null
@@ -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' = ()
index 2b128dc..b6b5572 100644 (file)
@@ -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, [''])