Commit f9308c2a authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Collect coercion variables, not type variables

...when tracking which constraints are used.

Previously we were gathering type variables too, which meant that the
ics_need field was (stupidly) non-empty, which meant that we kept hold
of solved implications for no purpose.  Better just to get rid of them,
which setImplicationStatus is all ste up to to do.

No change in behaviour; a bit more efficient.
parent 3562727f
......@@ -292,8 +292,8 @@ data EvBindsVar
-- The main payload: the value-level evidence bindings
-- (dictionaries etc)
ebv_tcvs :: IORef TyCoVarSet
-- The free vars of the (rhss of) the coercion bindings
ebv_tcvs :: IORef CoVarSet
-- The free coercion vars of the (rhss of) the coercion bindings
--
-- Coercions don't actually have bindings
-- because we plug them in-place (via a mutable
......
......@@ -2960,7 +2960,7 @@ setEvBind ev_bind
; wrapTcS $ TcM.addTcEvBind evb ev_bind }
-- | Mark variables as used filling a coercion hole
useVars :: TyCoVarSet -> TcS ()
useVars :: CoVarSet -> TcS ()
useVars vars
= do { EvBindsVar { ebv_tcvs = ref } <- getTcEvBindsVar
; wrapTcS $
......@@ -2971,7 +2971,7 @@ useVars vars
-- | Equalities only
setWantedEq :: TcEvDest -> Coercion -> TcS ()
setWantedEq (HoleDest hole) co
= do { useVars (tyCoVarsOfCo co)
= do { useVars (coVarsOfCo co)
; wrapTcS $ TcM.fillCoercionHole hole co }
setWantedEq (EvVarDest ev) _ = pprPanic "setWantedEq" (ppr ev)
......@@ -2984,7 +2984,7 @@ setEqIfWanted _ _ = return ()
setWantedEvTerm :: TcEvDest -> EvTerm -> TcS ()
setWantedEvTerm (HoleDest hole) tm
= do { let co = evTermCoercion tm
; useVars (tyCoVarsOfCo co)
; useVars (coVarsOfCo co)
; wrapTcS $ TcM.fillCoercionHole hole co }
setWantedEvTerm (EvVarDest ev) tm = setWantedEvBind ev tm
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment