[Git][ghc/ghc][wip/int-index/term-capture] Add missing filterInScopeM

Vladislav Zavialov (@int-index) gitlab at gitlab.haskell.org
Wed Aug 2 12:14:36 UTC 2023



Vladislav Zavialov pushed to branch wip/int-index/term-capture at Glasgow Haskell Compiler / GHC


Commits:
488924a4 by Vladislav Zavialov at 2023-08-02T14:14:27+02:00
Add missing filterInScopeM

- - - - -


2 changed files:

- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Tc/Gen/Splice.hs


Changes:

=====================================
compiler/GHC/Rename/HsType.hs
=====================================
@@ -887,13 +887,15 @@ bindHsQTyVars doc mb_assoc body_kv_occs hsq_bndrs thing_inside
 
        ; let -- See Note [bindHsQTyVars examples] for what
              -- all these various things are doing
-             bndrs, implicit_kvs :: [LocatedN RdrName]
+             bndrs, implicit_kvs' :: [LocatedN RdrName]
              bndrs        = map hsLTyVarLocName hs_tv_bndrs
-             implicit_kvs = filterFreeVarsToBind bndrs $
+             implicit_kvs' = filterFreeVarsToBind bndrs $
                bndr_kv_occs ++ body_kv_occs
              body_remaining = filterFreeVarsToBind bndr_kv_occs $
               filterFreeVarsToBind bndrs body_kv_occs
 
+       ; implicit_kvs <- filterInScopeM implicit_kvs'
+
        ; traceRn "checkMixedVars3" $
            vcat [ text "bndrs"   <+> ppr hs_tv_bndrs
                 , text "bndr_kv_occs"   <+> ppr bndr_kv_occs


=====================================
compiler/GHC/Tc/Gen/Splice.hs
=====================================
@@ -1884,7 +1884,7 @@ reifyInstances' th_nm th_tys
         ; rdr_ty <- cvt th_origin loc (mkThAppTs (TH.ConT th_nm) th_tys)
           -- #9262 says to bring vars into scope, like in HsForAllTy case
           -- of rnHsTyKi
-        ; let tv_rdrs = extractHsTyRdrTyVars rdr_ty
+        ; tv_rdrs <- filterInScopeM $ extractHsTyRdrTyVars rdr_ty
           -- Rename  to HsType Name
         ; ((tv_names, rn_ty), _fvs)
             <- checkNoErrs $ -- If there are out-of-scope Names here, then we



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/488924a4bac1caf0df3736e5013eae2ff7cd036f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/488924a4bac1caf0df3736e5013eae2ff7cd036f
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230802/2da34bd8/attachment-0001.html>


More information about the ghc-commits mailing list