diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/indexed-types/should_fail/T12041.hs | 12 | ||||
-rw-r--r-- | testsuite/tests/indexed-types/should_fail/T12041.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/indexed-types/should_fail/all.T | 1 |
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, ['']) |