diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2022-07-22 11:45:57 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-07-25 14:38:50 -0400 |
commit | 61faff40394c67956f53064b357e5b870c4de6c9 (patch) | |
tree | 390a35a3e4153888412f0bb8d6a0ce55cd575c03 /compiler/GHC/Tc/Gen | |
parent | 65f7838a281fb2e9fe28e38d2fe88e06deda27a0 (diff) | |
download | haskell-61faff40394c67956f53064b357e5b870c4de6c9.tar.gz |
Get the in-scope set right in FamInstEnv.injectiveBranches
There was an assert error, as Gergo pointed out in #21896.
I fixed this by adding an InScopeSet argument to tcUnifyTyWithTFs.
And also to GHC.Core.Unify.niFixTCvSubst.
I also took the opportunity to get a couple more InScopeSets right,
and to change some substTyUnchecked into substTy.
This MR touches a lot of other files, but only because I also took the
opportunity to introduce mkInScopeSetList, and use it.
Diffstat (limited to 'compiler/GHC/Tc/Gen')
-rw-r--r-- | compiler/GHC/Tc/Gen/HsType.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Tc/Gen/HsType.hs b/compiler/GHC/Tc/Gen/HsType.hs index 8d666fb7b0..d045984024 100644 --- a/compiler/GHC/Tc/Gen/HsType.hs +++ b/compiler/GHC/Tc/Gen/HsType.hs @@ -1058,7 +1058,7 @@ tc_infer_hs_type _ (XHsType ty) subst_prs = [ (getUnique nm, tv) | ATyVar nm tv <- nonDetNameEnvElts (tcl_env env) ] subst = mkTvSubst - (mkInScopeSet $ mkVarSet $ map snd subst_prs) + (mkInScopeSetList $ map snd subst_prs) (listToUFM_Directly $ map (liftSnd mkTyVarTy) subst_prs) ty' = substTy subst ty return (ty', tcTypeKind ty') @@ -3663,7 +3663,7 @@ etaExpandAlgTyCon flav skol_info tcbs res_kind = return ([], res_kind) where tyvars = binderVars tcbs - in_scope = mkInScopeSet (mkVarSet tyvars) + in_scope = mkInScopeSetList tyvars avoid_occs = map getOccName tyvars needsEtaExpansion :: TyConFlavour -> Bool |