diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2021-08-18 11:22:32 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2021-08-18 11:26:03 +0100 |
commit | 0237730b40dc6120667260011bc54175cf52f363 (patch) | |
tree | 853e03417f08b623d2cfb2fbebac872a31031270 /compiler/GHC/Core/Subst.hs | |
parent | 0ba21dbe28882d506c3536c40224ebff337a9f49 (diff) | |
download | haskell-wip/T20200a.tar.gz |
Get the in-scope set right during RULE matchingwip/T20200a
There was a subtle error in the in-scope set during RULE matching,
which led to #20200 (not the original report, but the reports of
failures following an initial bug-fix commit).
This patch fixes the problem, and simplifies the code a bit.
In pariticular there was a very mysterious and ad-hoc in-scope set
extension in rnMatchBndr2, which is now moved to the right place,
namely in the Let case of match, where we do the floating.
I don't have a small repro case, alas.
Diffstat (limited to 'compiler/GHC/Core/Subst.hs')
-rw-r--r-- | compiler/GHC/Core/Subst.hs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/compiler/GHC/Core/Subst.hs b/compiler/GHC/Core/Subst.hs index 2d4eac114c..ddb8e71f1f 100644 --- a/compiler/GHC/Core/Subst.hs +++ b/compiler/GHC/Core/Subst.hs @@ -24,7 +24,7 @@ module GHC.Core.Subst ( emptySubst, mkEmptySubst, mkSubst, mkOpenSubst, substInScope, isEmptySubst, extendIdSubst, extendIdSubstList, extendTCvSubst, extendTvSubstList, extendSubst, extendSubstList, extendSubstWithVar, zapSubstEnv, - addInScopeSet, extendInScope, extendInScopeList, extendInScopeIds, + extendInScope, extendInScopeList, extendInScopeIds, isInScope, setInScope, getTCvSubst, extendTvSubst, extendCvSubst, delBndr, delBndrs, @@ -292,12 +292,6 @@ mkOpenSubst in_scope pairs = Subst in_scope isInScope :: Var -> Subst -> Bool isInScope v (Subst in_scope _ _ _) = v `elemInScopeSet` in_scope --- | Add the 'Var' to the in-scope set, but do not remove --- any existing substitutions for it -addInScopeSet :: Subst -> VarSet -> Subst -addInScopeSet (Subst in_scope ids tvs cvs) vs - = Subst (in_scope `extendInScopeSetSet` vs) ids tvs cvs - -- | Add the 'Var' to the in-scope set: as a side effect, -- and remove any existing substitutions for it extendInScope :: Subst -> Var -> Subst |