summaryrefslogtreecommitdiff
path: root/compiler/iface/BuildTyCl.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-01-26 09:37:06 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2016-01-26 09:48:20 +0000
commit1c6d70c2121fd1126fcc2458bdbcc856e19598c2 (patch)
treec03b376ba62d4c766333e9844ddcaa4c9f95a102 /compiler/iface/BuildTyCl.hs
parent47b3f58889caa71bf096a149e58c2a9b94b75a7d (diff)
downloadhaskell-1c6d70c2121fd1126fcc2458bdbcc856e19598c2.tar.gz
Kill off zipTopTCvSubst in favour of zipOpenTCvSubst
As Bartosz has discovered, the invariants for substitutions were wrong, and in particular the "mkTop...Subst" and "zipTop..Subst" functions were building substitutions that didn't obey even the old invariants. This patch kills of the bogus zipTopTCvSubst in favour of the more robust zipOpenTCvSubst. I tripped over this because my upcoming patch (concerning SetLevels, Trac #11330) triggered an ASSERT failure in the substitution well-formedness assertion in TyCoRep.
Diffstat (limited to 'compiler/iface/BuildTyCl.hs')
-rw-r--r--compiler/iface/BuildTyCl.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/iface/BuildTyCl.hs b/compiler/iface/BuildTyCl.hs
index 699fd5d366..d13d38e6ff 100644
--- a/compiler/iface/BuildTyCl.hs
+++ b/compiler/iface/BuildTyCl.hs
@@ -157,7 +157,7 @@ mkDataConStupidTheta tycon arg_tys univ_tvs
| null stupid_theta = [] -- The common case
| otherwise = filter in_arg_tys stupid_theta
where
- tc_subst = zipTopTCvSubst (tyConTyVars tycon) (mkTyVarTys univ_tvs)
+ tc_subst = zipOpenTCvSubst (tyConTyVars tycon) (mkTyVarTys univ_tvs)
stupid_theta = substTheta tc_subst (tyConStupidTheta tycon)
-- Start by instantiating the master copy of the
-- stupid theta, taken from the TyCon
@@ -205,8 +205,8 @@ buildPatSyn src_name declared_infix matcher@(matcher_id,_) builder
(ex_tvs1, prov_theta1, cont_tau) = tcSplitSigmaTy cont_sigma
(arg_tys1, _) = tcSplitFunTys cont_tau
twiddle = char '~'
- subst = zipTopTCvSubst (univ_tvs1 ++ ex_tvs1)
- (mkTyVarTys (univ_tvs ++ ex_tvs))
+ subst = zipOpenTCvSubst (univ_tvs1 ++ ex_tvs1)
+ (mkTyVarTys (univ_tvs ++ ex_tvs))
------------------------------------------------------
type TcMethInfo = (Name, Type, Maybe (DefMethSpec Type))