summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail088.stderr
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-02-08 09:05:12 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2016-02-08 09:07:07 +0000
commit2cf3cac6a05879c27fa82b12dd34cce39a262402 (patch)
tree53f91c0d6ab44292cbdf1d58481354ba681ba953 /testsuite/tests/typecheck/should_fail/tcfail088.stderr
parent8263d09e256d367f9a136fcc73d981879526a329 (diff)
downloadhaskell-2cf3cac6a05879c27fa82b12dd34cce39a262402.tar.gz
Allow foralls in instance decls
This patch finally makes it possible to have explicit foralls in an instance decl instance forall (a :: *). Eq a => Eq [a] where ... This is useful to allow kind signatures or indeed explicicit kind for-alls; see Trac #11519 I thought it would be really easy, because an instance declaration already contains an actual HsSigType, so all the syntactic baggage is there. But in fact it turned out that instance declarations were kind-checked a little differently, because the body kind of the forall is 'Constraint' rather than '*'. So I fixed that. There a slight kludge (see Note [Body kind of a HsQualTy], but it's still a significant improvement. I also did the usual other round of refactoring, improved a few error messages, tidied up comments etc. The only significant aspect of all that was * Kill mkNakedSpecSigmaTy, mkNakedPhiTy, mkNakedFunTy These function names suggest that they do something complicated, but acutally they do nothing. So I killed them. * Swap the arg order of mkNamedBinder, just so that it is convenient to say 'map (mkNamedBinder Invisible) tvs' * I had to improve isPredTy, to deal with (illegal) types like (Eq a => Eq [a]) => blah See Note [isPeredTy complications] in Type.hs Still to come: user manual documentation for the instance-decl change.
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/tcfail088.stderr')
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail088.stderr8
1 files changed, 4 insertions, 4 deletions
diff --git a/testsuite/tests/typecheck/should_fail/tcfail088.stderr b/testsuite/tests/typecheck/should_fail/tcfail088.stderr
index 1aedd2a43c..04081aba99 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail088.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail088.stderr
@@ -1,4 +1,4 @@
-
-tcfail088.hs:9:19:
- Illegal polymorphic or qualified type: forall s1. T s1 a
- In the instance declaration for ‘Ord (forall s. T s a)’
+
+tcfail088.hs:9:19: error:
+ • Illegal polymorphic type: forall s. T s a
+ • In the instance declaration for ‘Ord (forall s. T s a)’