summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types
diff options
context:
space:
mode:
authorRichard Eisenberg <rae@richarde.dev>2019-08-17 19:03:23 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-09-17 19:22:00 -0400
commit9c21b2fd041f19ad02f1c1d530a3f9cbf092c622 (patch)
treeecb0343f6a0a906fe4745f892383a4ce7fa81921 /testsuite/tests/indexed-types
parentae4415b9487d24942aa0e91052d4b897a3cf2f2e (diff)
downloadhaskell-9c21b2fd041f19ad02f1c1d530a3f9cbf092c622.tar.gz
Fix #13571 by adding an extension flag check
Test case: indexed-types/should_fail/T13571
Diffstat (limited to 'testsuite/tests/indexed-types')
-rw-r--r--testsuite/tests/indexed-types/should_fail/T13571.hs6
-rw-r--r--testsuite/tests/indexed-types/should_fail/T13571.stderr5
-rw-r--r--testsuite/tests/indexed-types/should_fail/T13571a.hs7
-rw-r--r--testsuite/tests/indexed-types/should_fail/T13571a.stderr5
-rw-r--r--testsuite/tests/indexed-types/should_fail/all.T2
5 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_fail/T13571.hs b/testsuite/tests/indexed-types/should_fail/T13571.hs
new file mode 100644
index 0000000000..87036c801f
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T13571.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE TypeFamilies #-}
+
+module T13571 where
+
+type family F a = r where
+ F a = a
diff --git a/testsuite/tests/indexed-types/should_fail/T13571.stderr b/testsuite/tests/indexed-types/should_fail/T13571.stderr
new file mode 100644
index 0000000000..482d6024a0
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T13571.stderr
@@ -0,0 +1,5 @@
+
+T13571.hs:5:1: error:
+ • Illegal result type variable r for ‘F’
+ Enable TypeFamilyDependencies to allow result variable names
+ • In the type family declaration for ‘F’
diff --git a/testsuite/tests/indexed-types/should_fail/T13571a.hs b/testsuite/tests/indexed-types/should_fail/T13571a.hs
new file mode 100644
index 0000000000..f4330c6366
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T13571a.hs
@@ -0,0 +1,7 @@
+{-# LANGUAGE TypeFamilies #-}
+
+module T13571a where
+
+import Data.Kind
+
+type family G a = (r :: Type)
diff --git a/testsuite/tests/indexed-types/should_fail/T13571a.stderr b/testsuite/tests/indexed-types/should_fail/T13571a.stderr
new file mode 100644
index 0000000000..f92e5a909a
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T13571a.stderr
@@ -0,0 +1,5 @@
+
+T13571a.hs:7:1: error:
+ • Illegal result type variable (r :: Type) for ‘G’
+ Enable TypeFamilyDependencies to allow result variable names
+ • In the type family declaration for ‘G’
diff --git a/testsuite/tests/indexed-types/should_fail/all.T b/testsuite/tests/indexed-types/should_fail/all.T
index ca1781b8fd..a419610f9e 100644
--- a/testsuite/tests/indexed-types/should_fail/all.T
+++ b/testsuite/tests/indexed-types/should_fail/all.T
@@ -160,3 +160,5 @@ test('T16356_Fail1', normal, compile_fail, [''])
test('T16356_Fail2', normal, compile_fail, [''])
test('T16356_Fail3', normal, compile_fail, [''])
test('T17008a', normal, compile_fail, ['-fprint-explicit-kinds'])
+test('T13571', normal, compile_fail, [''])
+test('T13571a', normal, compile_fail, [''])