Test Trac #9318
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 21 Nov 2014 11:12:16 +0000 (11:12 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Fri, 21 Nov 2014 11:35:26 +0000 (11:35 +0000)
testsuite/tests/indexed-types/should_fail/T9318.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/T9318.stderr [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/all.T

diff --git a/testsuite/tests/indexed-types/should_fail/T9318.hs b/testsuite/tests/indexed-types/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/indexed-types/should_fail/T9318.stderr b/testsuite/tests/indexed-types/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 286360a..998193f 100644 (file)
@@ -131,3 +131,4 @@ test('BadSock', normal, compile_fail, [''])
 test('T9580', normal, multimod_compile_fail, ['T9580', ''])
 test('T9662', normal, compile_fail, [''])
 test('T7862', normal, compile_fail, [''])
+test('T9318', normal, compile_fail, [''])