diff options
author | Bartosz Nitka <niteria@gmail.com> | 2016-01-19 03:25:39 -0800 |
---|---|---|
committer | Bartosz Nitka <niteria@gmail.com> | 2016-01-19 03:26:02 -0800 |
commit | 9d33adb6f352ad4e488067a8756928b3778920e0 (patch) | |
tree | 506b6ffa5eadb0678d7c1ba22441c46b8d4b3ac9 /compiler/iface/BuildTyCl.hs | |
parent | 80265c4c3c827695e92dd9620faf47e064b5da37 (diff) | |
download | haskell-9d33adb6f352ad4e488067a8756928b3778920e0.tar.gz |
Check InScopeSet in substTy and provide substTyUnchecked
This adds sanity checks to `substTy` that implement:
> when calling substTy subst ty it should be the case that the in-scope
> set in the substitution is a superset of
> * The free vars of the range of the substitution
> * The free vars of ty minus the domain of the substitution
and replaces violators with unchecked version. The violators were found
by running the GHC test suite.
This ensures that I can work on this incrementally and that what I fix won't
be undone by some other change.
It also includes a couple of fixes that I've already done.
Test Plan: ./validate
Reviewers: simonmar, goldfire, simonpj, austin, bgamari
Reviewed By: simonpj, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1792
GHC Trac Issues: #11371
Diffstat (limited to 'compiler/iface/BuildTyCl.hs')
-rw-r--r-- | compiler/iface/BuildTyCl.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/iface/BuildTyCl.hs b/compiler/iface/BuildTyCl.hs index 0015e01278..75e8875d59 100644 --- a/compiler/iface/BuildTyCl.hs +++ b/compiler/iface/BuildTyCl.hs @@ -184,7 +184,7 @@ buildPatSyn src_name declared_infix matcher@(matcher_id,_) builder -- compatible with the pattern synonym ASSERT2((and [ univ_tvs `equalLength` univ_tvs1 , ex_tvs `equalLength` ex_tvs1 - , pat_ty `eqType` substTy subst pat_ty1 + , pat_ty `eqType` substTyUnchecked subst pat_ty1 , prov_theta `eqTypes` substTys subst prov_theta1 , req_theta `eqTypes` substTys subst req_theta1 , arg_tys `eqTypes` substTys subst arg_tys1 |