summaryrefslogtreecommitdiff
path: root/testsuite/tests/driver
diff options
context:
space:
mode:
authorJan Stolarek <jan.stolarek@p.lodz.pl>2016-01-09 20:58:52 +0100
committerBen Gamari <ben@smart-cactus.org>2016-01-09 20:58:54 +0100
commitfbd6de2f0761b63a5f0a88ce0590f515d63790a4 (patch)
treec3bf647973fb4b675731a27d15af9919cd29d9e2 /testsuite/tests/driver
parent5cb236dd6b497da0b9072b20ca74c298477f7a61 (diff)
downloadhaskell-fbd6de2f0761b63a5f0a88ce0590f515d63790a4.tar.gz
Add InjectiveTypeFamilies language extension
Previously injective type families were part of TypeFamilies. Now they are in a separate language extension. Test Plan: ./validate Reviewers: austin, bgamari, goldfire Reviewed By: bgamari Subscribers: goldfire, thomie Differential Revision: https://phabricator.haskell.org/D1750 GHC Trac Issues: #11381
Diffstat (limited to 'testsuite/tests/driver')
-rw-r--r--testsuite/tests/driver/T11381.hs9
-rw-r--r--testsuite/tests/driver/T11381.stderr5
-rw-r--r--testsuite/tests/driver/T4437.hs3
-rw-r--r--testsuite/tests/driver/all.T1
4 files changed, 17 insertions, 1 deletions
diff --git a/testsuite/tests/driver/T11381.hs b/testsuite/tests/driver/T11381.hs
new file mode 100644
index 0000000000..8dc94dd8a7
--- /dev/null
+++ b/testsuite/tests/driver/T11381.hs
@@ -0,0 +1,9 @@
+{-# LANGUAGE TypeFamilies #-}
+
+module T11381 where
+
+-- ensure that this code does not compile without InjectiveTypeFamilies and that
+-- injectivity error is not reported.
+type family F a = r | r -> a
+type instance F Int = Bool
+type instance F Int = Char
diff --git a/testsuite/tests/driver/T11381.stderr b/testsuite/tests/driver/T11381.stderr
new file mode 100644
index 0000000000..afe652d38e
--- /dev/null
+++ b/testsuite/tests/driver/T11381.stderr
@@ -0,0 +1,5 @@
+
+T11381.hs:7:23:
+ Illegal injectivity annotation
+ Use InjectiveTypeFamilies to allow this
+ In the type family declaration for ‘F’
diff --git a/testsuite/tests/driver/T4437.hs b/testsuite/tests/driver/T4437.hs
index 5f14da1a9a..cbf71868bd 100644
--- a/testsuite/tests/driver/T4437.hs
+++ b/testsuite/tests/driver/T4437.hs
@@ -38,7 +38,8 @@ check title expected got
expectedGhcOnlyExtensions :: [String]
expectedGhcOnlyExtensions = ["RelaxedLayout",
"AlternativeLayoutRule",
- "AlternativeLayoutRuleTransitional"]
+ "AlternativeLayoutRuleTransitional",
+ "InjectiveTypeFamilies"]
expectedCabalOnlyExtensions :: [String]
expectedCabalOnlyExtensions = ["Generics",
diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T
index 8493aa4c57..e0022d7d60 100644
--- a/testsuite/tests/driver/all.T
+++ b/testsuite/tests/driver/all.T
@@ -466,3 +466,4 @@ test('T10970', normal, compile_and_run, ['-hide-all-packages -package base -pack
test('T10970a', normal, compile_and_run, [''])
test('T4931', normal, compile_and_run, [''])
test('T11182', normal, compile_and_run, [''])
+test('T11381', normal, compile_fail, [''])