Add test for T10836 (expected broken)
authorJan Stolarek <jan.stolarek@p.lodz.pl>
Thu, 3 Sep 2015 17:28:44 +0000 (19:28 +0200)
committerJan Stolarek <jan.stolarek@p.lodz.pl>
Thu, 3 Sep 2015 17:28:44 +0000 (19:28 +0200)
testsuite/tests/typecheck/should_fail/T10836.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T10836.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T

diff --git a/testsuite/tests/typecheck/should_fail/T10836.hs b/testsuite/tests/typecheck/should_fail/T10836.hs
new file mode 100644 (file)
index 0000000..00c5c6a
--- /dev/null
@@ -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 (file)
index 0000000..b96d371
--- /dev/null
@@ -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’
index 85532de..66b8a86 100644 (file)
@@ -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, [''])