Commit fb74d717 authored by cactus's avatar cactus

Assert that matcher-derived PatSyn types match the (redundant) stored types in IfacePatSyn

parent ac2796e6
......@@ -193,7 +193,14 @@ buildPatSyn :: Name -> Bool
-> PatSyn
buildPatSyn src_name declared_infix matcher wrapper
args univ_tvs ex_tvs prov_theta req_theta pat_ty
= mkPatSyn src_name declared_infix
= ASSERT((and [ univ_tvs == univ_tvs'
, ex_tvs == ex_tvs'
, pat_ty `eqType` pat_ty'
, prov_theta `eqTypes` prov_theta'
, req_theta `eqTypes` req_theta'
, args `eqTypes` args'
]))
mkPatSyn src_name declared_infix
args
univ_tvs ex_tvs
prov_theta req_theta
......@@ -201,12 +208,10 @@ buildPatSyn src_name declared_infix matcher wrapper
matcher
wrapper
where
-- TODO: assert that these match the ones in the parameters
((_:_univ_tvs'), _req_theta', tau) = tcSplitSigmaTy $ idType matcher
([_pat_ty', cont_sigma, _], _) = tcSplitFunTys tau
(_ex_tvs', _prov_theta', cont_tau) = tcSplitSigmaTy cont_sigma
(_args', _) = tcSplitFunTys cont_tau
((_:univ_tvs'), req_theta', tau) = tcSplitSigmaTy $ idType matcher
([pat_ty', cont_sigma, _], _) = tcSplitFunTys tau
(ex_tvs', prov_theta', cont_tau) = tcSplitSigmaTy cont_sigma
(args', _) = tcSplitFunTys cont_tau
\end{code}
......
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