[commit: ghc] master: Add test for T10836 (expected broken) (5dc88b7)
git at git.haskell.org
git at git.haskell.org
Thu Sep 3 17:27:21 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/5dc88b72e4c3cc066e19ea5ece98ce152cd0ca25/ghc
>---------------------------------------------------------------
commit 5dc88b72e4c3cc066e19ea5ece98ce152cd0ca25
Author: Jan Stolarek <jan.stolarek at p.lodz.pl>
Date: Thu Sep 3 19:28:44 2015 +0200
Add test for T10836 (expected broken)
>---------------------------------------------------------------
5dc88b72e4c3cc066e19ea5ece98ce152cd0ca25
testsuite/tests/typecheck/should_fail/T10836.hs | 10 ++++++++++
testsuite/tests/typecheck/should_fail/T10836.stderr | 14 ++++++++++++++
testsuite/tests/typecheck/should_fail/all.T | 1 +
3 files changed, 25 insertions(+)
diff --git a/testsuite/tests/typecheck/should_fail/T10836.hs b/testsuite/tests/typecheck/should_fail/T10836.hs
new file mode 100644
index 0000000..00c5c6a
--- /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 0000000..b96d371
--- /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 85532de..66b8a86 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, [''])
More information about the ghc-commits
mailing list