summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-05-16 13:42:22 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2016-05-19 10:44:47 +0100
commitad7f12260e227e849b815f4959df0f886ecbe807 (patch)
tree87bf68f8b93edf684b00dbc80a528d4a5286d66f /testsuite
parent72b677d31e39f417e4403b1b151f02913f483d32 (diff)
downloadhaskell-ad7f12260e227e849b815f4959df0f886ecbe807.tar.gz
Improve pretty-printing of equalities
The previous pretty-printer didn't account for partially applied equalities, causing Trac #12041
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/indexed-types/should_fail/T12041.hs12
-rw-r--r--testsuite/tests/indexed-types/should_fail/T12041.stderr7
-rw-r--r--testsuite/tests/indexed-types/should_fail/all.T1
3 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_fail/T12041.hs b/testsuite/tests/indexed-types/should_fail/T12041.hs
new file mode 100644
index 0000000000..9210280920
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T12041.hs
@@ -0,0 +1,12 @@
+{-# Language PolyKinds, TypeFamilies #-}
+
+module T12041 where
+
+import Data.Kind
+
+class Category (p :: i -> i -> Type) where
+ type Ob p :: i -> Constraint
+
+data I a b
+instance Category I where
+ type Ob I = (~) Int
diff --git a/testsuite/tests/indexed-types/should_fail/T12041.stderr b/testsuite/tests/indexed-types/should_fail/T12041.stderr
new file mode 100644
index 0000000000..006ca37bae
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T12041.stderr
@@ -0,0 +1,7 @@
+
+T12041.hs:12:15: error:
+ • Expected kind ‘i -> Constraint’,
+ but ‘(~) Int’ has kind ‘* -> Constraint’
+ • In the type ‘(~) Int’
+ In the type instance declaration for ‘Ob’
+ In the instance declaration for ‘Category I’
diff --git a/testsuite/tests/indexed-types/should_fail/all.T b/testsuite/tests/indexed-types/should_fail/all.T
index dfc0326154..041282eadf 100644
--- a/testsuite/tests/indexed-types/should_fail/all.T
+++ b/testsuite/tests/indexed-types/should_fail/all.T
@@ -140,3 +140,4 @@ test('T10899', normal, compile_fail, [''])
test('T11136', normal, compile_fail, [''])
test('T7788', normal, compile_fail, [''])
test('T11450', normal, compile_fail, [''])
+test('T12041', normal, compile_fail, [''])