summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Stolarek <jan.stolarek@p.lodz.pl>2015-09-03 19:28:44 +0200
committerJan Stolarek <jan.stolarek@p.lodz.pl>2015-09-03 19:28:44 +0200
commit5dc88b72e4c3cc066e19ea5ece98ce152cd0ca25 (patch)
tree40f9c907d857e88f2aff9ed257e8fbbaf72839eb
parent374457809de343f409fbeea0a885877947a133a2 (diff)
downloadhaskell-5dc88b72e4c3cc066e19ea5ece98ce152cd0ca25.tar.gz
Add test for T10836 (expected broken)
-rw-r--r--testsuite/tests/typecheck/should_fail/T10836.hs10
-rw-r--r--testsuite/tests/typecheck/should_fail/T10836.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T1
3 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T10836.hs b/testsuite/tests/typecheck/should_fail/T10836.hs
new file mode 100644
index 0000000000..00c5c6a650
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T10836.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE TypeFamilies #-}
+module T10836 where
+
+type family Foo a = r | r -> a where
+ Foo Int = Int
+ Foo Bool = Int
+
+type family Bar a = r | r -> a where
+ Bar Int = Int
+ Bar Bool = Int
diff --git a/testsuite/tests/typecheck/should_fail/T10836.stderr b/testsuite/tests/typecheck/should_fail/T10836.stderr
new file mode 100644
index 0000000000..b96d3714e2
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T10836.stderr
@@ -0,0 +1,14 @@
+
+T10836.hs:5:5: error:
+ Type family equations violate injectivity annotation:
+ Foo Int = Int
+ Foo Bool = Int
+ In the equations for closed type family ‘Foo’
+ In the type family declaration for ‘Foo’
+
+T10836.hs:9:5: error:
+ Type family equations violate injectivity annotation:
+ Bar Int = Int
+ Bar Bool = Int
+ In the equations for closed type family ‘Bar’
+ In the type family declaration for ‘Bar’
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 85532dede5..66b8a86fdb 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -395,3 +395,4 @@ test('ExpandSynsFail2', normal, compile_fail, ['-fprint-expanded-synonyms'])
test('ExpandSynsFail3', normal, compile_fail, ['-fprint-expanded-synonyms'])
test('ExpandSynsFail4', normal, compile_fail, ['-fprint-expanded-synonyms'])
test('T10698', expect_broken(10698), compile_fail, [''])
+test('T10836', expect_broken(10836), compile_fail, [''])