Test Trac #12867
authorSimon Peyton Jones <simonpj@microsoft.com>
Tue, 22 Nov 2016 10:35:28 +0000 (10:35 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Fri, 25 Nov 2016 17:46:50 +0000 (17:46 +0000)
testsuite/tests/indexed-types/should_fail/T12867.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/T12867.stderr [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/all.T

diff --git a/testsuite/tests/indexed-types/should_fail/T12867.hs b/testsuite/tests/indexed-types/should_fail/T12867.hs
new file mode 100644 (file)
index 0000000..e4a39ce
--- /dev/null
@@ -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 (file)
index 0000000..e712c49
--- /dev/null
@@ -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’
index 4b0e994..8c24344 100644 (file)
@@ -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, [''])