summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/polykinds/T10570.hs11
-rw-r--r--testsuite/tests/polykinds/T10570.stderr9
-rw-r--r--testsuite/tests/polykinds/T9106.stderr3
-rw-r--r--testsuite/tests/polykinds/all.T1
-rw-r--r--testsuite/tests/typecheck/should_fail/T2247.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail170.stderr3
6 files changed, 27 insertions, 3 deletions
diff --git a/testsuite/tests/polykinds/T10570.hs b/testsuite/tests/polykinds/T10570.hs
new file mode 100644
index 0000000000..259a32bd6c
--- /dev/null
+++ b/testsuite/tests/polykinds/T10570.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE FunctionalDependencies, PolyKinds, FlexibleInstances #-}
+
+module T10570 where
+
+import Data.Proxy
+
+class ConsByIdx2 x a m cls | x -> m where
+ consByIdx2 :: x -> a -> m cls
+
+instance ConsByIdx2 Int a Proxy cls where
+ consByIdx2 _ _ = Proxy
diff --git a/testsuite/tests/polykinds/T10570.stderr b/testsuite/tests/polykinds/T10570.stderr
new file mode 100644
index 0000000000..f40ed10ce4
--- /dev/null
+++ b/testsuite/tests/polykinds/T10570.stderr
@@ -0,0 +1,9 @@
+
+T10570.hs:10:10: error:
+ Illegal instance declaration for ‘ConsByIdx2 Int a Proxy cls’
+ The coverage condition fails in class ‘ConsByIdx2’
+ for functional dependency: ‘x -> m’
+ Reason: lhs type ‘Int’ does not determine rhs type ‘Proxy’
+ Un-determined variable: k
+ (Use -fprint-explicit-kinds to see the kind variables in the types)
+ In the instance declaration for ‘ConsByIdx2 Int a Proxy cls’
diff --git a/testsuite/tests/polykinds/T9106.stderr b/testsuite/tests/polykinds/T9106.stderr
index 0b239f2ea4..bbb363349e 100644
--- a/testsuite/tests/polykinds/T9106.stderr
+++ b/testsuite/tests/polykinds/T9106.stderr
@@ -1,8 +1,9 @@
-T9106.hs:13:10:
+T9106.hs:13:10: error:
Illegal instance declaration for ‘FunctorN n f a (f fa)’
The liberal coverage condition fails in class ‘FunctorN’
for functional dependency: ‘n f a -> fa’
Reason: lhs types ‘n’, ‘f’, ‘a’
do not jointly determine rhs type ‘f fa’
+ Un-determined variable: fa
In the instance declaration for ‘FunctorN n f a (f fa)’
diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T
index 95f0d8321a..8a8f8b5f58 100644
--- a/testsuite/tests/polykinds/all.T
+++ b/testsuite/tests/polykinds/all.T
@@ -118,3 +118,4 @@ test('T10041', normal, compile, [''])
test('T10451', normal, compile_fail, [''])
test('T10516', normal, compile_fail, [''])
test('T10503', normal, compile_fail, [''])
+test('T10570', normal, compile_fail, [''])
diff --git a/testsuite/tests/typecheck/should_fail/T2247.stderr b/testsuite/tests/typecheck/should_fail/T2247.stderr
index edf4246b46..54a6c2a23d 100644
--- a/testsuite/tests/typecheck/should_fail/T2247.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2247.stderr
@@ -1,7 +1,8 @@
-T2247.hs:6:10:
+T2247.hs:6:10: error:
Illegal instance declaration for ‘FD a b’
The liberal coverage condition fails in class ‘FD’
for functional dependency: ‘a -> b’
Reason: lhs type ‘a’ does not determine rhs type ‘b’
+ Un-determined variable: b
In the instance declaration for ‘FD a b’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail170.stderr b/testsuite/tests/typecheck/should_fail/tcfail170.stderr
index bb952ba374..77e2ca3bfb 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail170.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail170.stderr
@@ -1,7 +1,8 @@
-tcfail170.hs:7:10:
+tcfail170.hs:7:10: error:
Illegal instance declaration for ‘C [p] [q]’
The coverage condition fails in class ‘C’
for functional dependency: ‘a -> b’
Reason: lhs type ‘[p]’ does not determine rhs type ‘[q]’
+ Un-determined variable: q
In the instance declaration for ‘C [p] [q]’