From f0f468262d8b3932de0ce79f4fd98fecf51a62a3 Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Tue, 22 Nov 2016 10:35:28 +0000 Subject: Test Trac #12867 --- testsuite/tests/indexed-types/should_fail/T12867.hs | 10 ++++++++++ testsuite/tests/indexed-types/should_fail/T12867.stderr | 12 ++++++++++++ testsuite/tests/indexed-types/should_fail/all.T | 1 + 3 files changed, 23 insertions(+) create mode 100644 testsuite/tests/indexed-types/should_fail/T12867.hs create mode 100644 testsuite/tests/indexed-types/should_fail/T12867.stderr (limited to 'testsuite') diff --git a/testsuite/tests/indexed-types/should_fail/T12867.hs b/testsuite/tests/indexed-types/should_fail/T12867.hs new file mode 100644 index 0000000000..e4a39ce56e --- /dev/null +++ b/testsuite/tests/indexed-types/should_fail/T12867.hs @@ -0,0 +1,10 @@ +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE FlexibleContexts #-} + +module T12866 where + +type Test2 a = (Eq (TestM a)) + +class Test a where + type TestM :: * diff --git a/testsuite/tests/indexed-types/should_fail/T12867.stderr b/testsuite/tests/indexed-types/should_fail/T12867.stderr new file mode 100644 index 0000000000..e712c49c4f --- /dev/null +++ b/testsuite/tests/indexed-types/should_fail/T12867.stderr @@ -0,0 +1,12 @@ + +T12867.hs:7:21: error: + • Expecting one fewer arguments to ‘TestM’ + Expected kind ‘k0 -> *’, but ‘TestM’ has kind ‘*’ + • In the first argument of ‘Eq’, namely ‘TestM a’ + In the type ‘Eq (TestM a)’ + In the type declaration for ‘Test2’ + +T12867.hs:9:1: error: + • The associated type ‘TestM’ + mentions none of the type or kind variables of the class ‘Test a’ + • In the class declaration for ‘Test’ diff --git a/testsuite/tests/indexed-types/should_fail/all.T b/testsuite/tests/indexed-types/should_fail/all.T index 4b0e994610..8c243440dc 100644 --- a/testsuite/tests/indexed-types/should_fail/all.T +++ b/testsuite/tests/indexed-types/should_fail/all.T @@ -139,3 +139,4 @@ test('T7788', normal, compile_fail, ['']) test('T11450', normal, compile_fail, ['']) test('T12041', normal, compile_fail, ['']) test('T12522a', normal, compile_fail, ['']) +test('T12867', normal, compile_fail, ['']) -- cgit v1.2.1