Commit 807ab222 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Fix the bind-recovery type

This patch uses (forall (a::*). a) for the type to
use when recovering from an error in a binding.

Previously (Trac #15276) we had (forall r (a :: TYPE r). a),
which is ill-kinded.

It's quite hard to provoke an error arising from this, because
it only happens in programs that have a type error anyway,
but in a subequent patch I make typeKind fall over if it returns
an ill-scoped kind, and that makes ghci/scripts/T13202 crash
without this fix.
parent 01c9d95a
......@@ -646,7 +646,13 @@ recoveryCode binder_names sig_fn
= mkLocalId name forall_a_a
forall_a_a :: TcType
forall_a_a = mkSpecForAllTys [runtimeRep1TyVar, openAlphaTyVar] openAlphaTy
-- At one point I had (forall r (a :: TYPE r). a), but of course
-- that type is ill-formed: its mentions 'r' which escapes r's scope.
-- Another alternative would be (forall (a :: TYPE kappa). a), where
-- kappa is a unification variable. But I don't think we need that
-- complication here. I'm going to just use (forall (a::*). a).
-- See Trac #15276
forall_a_a = mkSpecForAllTys [alphaTyVar] alphaTy
{- *********************************************************************
* *
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment