Simon Peyton Jones pushed to branch wip/spj-reinstallable-base2 at Glasgow Haskell Compiler / GHC Commits: eae15e45 by Simon Peyton Jones at 2026-04-17T12:55:28+01:00 Knot-tying nonsense [skip ci] I ended up extending KKKNS_InScope - - - - - 13 changed files: - compiler/GHC/Driver/Env.hs - compiler/GHC/Driver/Env/Types.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Types.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Instance/Typeable.hs - compiler/GHC/Tc/Module.hs - compiler/GHC/Tc/Types.hs - compiler/GHC/Tc/Utils/Backpack.hs - compiler/GHC/Tc/Utils/Env.hs - compiler/GHC/Tc/Utils/Monad.hs Changes: ===================================== compiler/GHC/Driver/Env.hs ===================================== @@ -178,16 +178,16 @@ configured via command-line flags (in `GHC.setTopSessionDynFlags`). -- Note [hsc_type_env_var hack] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- hsc_type_env_var is used to initialize tcg_type_env_var, and +-- hsc_type_env_var is used to initialize tcg_knot_vars, and -- eventually it is the mutable variable that is queried from -- if_rec_types to get a TypeEnv. So, clearly, it's something -- related to knot-tying (see Note [Tying the knot]). -- hsc_type_env_var is used in two places: initTcRn (where --- it initializes tcg_type_env_var) and initIfaceCheck +-- it initializes tcg_knot_vars) and initIfaceCheck -- (where it initializes if_rec_types). -- -- But why do we need a way to feed a mutable variable in? Why --- can't we just initialize tcg_type_env_var when we start +-- can't we just initialize tcg_knot_vars when we start -- typechecking? The problem is we need to knot-tie the -- EPS, and we may start adding things to the EPS before type -- checking starts. ===================================== compiler/GHC/Driver/Env/Types.hs ===================================== @@ -83,8 +83,8 @@ data HscEnv hsc_type_env_vars :: KnotVars (IORef TypeEnv) -- ^ Used for one-shot compilation only, to initialise - -- the 'IfGblEnv'. See 'GHC.Tc.Utils.tcg_type_env_var' for - -- 'GHC.Tc.Utils.TcGblEnv'. See also Note [hsc_type_env_var hack] + -- the 'IfGblEnv'. See 'tcg_knot_vars' in 'GHC.Tc.Utils.TcGblEnv'. + -- See also Note [hsc_type_env_var hack] , hsc_interp :: Maybe Interp -- ^ target code interpreter (if any) to use for TH and GHCi. ===================================== compiler/GHC/Driver/Pipeline/Execute.hs ===================================== @@ -731,7 +731,7 @@ runHscPhase pipe_env hsc_env0 input_fn src_flavour = do mg <- downsweepThunk hsc_env mod_summary -- Need to set the knot-tying mutable variable for interface - -- files. See GHC.Tc.Utils.TcGblEnv.tcg_type_env_var. + -- files. See GHC.Tc.Utils.TcGblEnv.tcg_knot_vars -- See also Note [hsc_type_env_var hack] type_env_var <- newIORef emptyNameEnv let hsc_env' = ===================================== compiler/GHC/HsToCore/Monad.hs ===================================== @@ -578,8 +578,10 @@ dsGetKnownKeySource :: DsM KnownKeyNameSource dsGetKnownKeySource = do { rebindable_path <- goptM Opt_RebindableKnownKeyNames ; if rebindable_path - then do { rdr_env <- dsGetGlobalRdrEnv - ; return (KKNS_InScope rdr_env) } + then do { env <- getGblEnv + ; return (KKNS_InScope (ds_mod env) + (ds_gbl_rdr_env env) + (ds_type_env env)) } else return KKNS_FromModule } -------------------------------------- ===================================== compiler/GHC/HsToCore/Types.hs ===================================== @@ -59,12 +59,14 @@ presumably include source-file location information: data DsGblEnv = DsGblEnv { ds_mod :: Module -- For SCC profiling - , ds_fam_inst_env :: FamInstEnv -- Like tcg_fam_inst_env , ds_gbl_rdr_env :: GlobalRdrEnv -- The GlobalRdrEnv is needed for the following reasons: -- - to know what newtype constructors are in scope -- - to check whether all members of a COMPLETE pragma are in scope -- - when looking up know-key names + , ds_fam_inst_env :: FamInstEnv -- Like tcg_fam_inst_env + , ds_type_env :: TypeEnv -- Like tcg_type_enb + , ds_name_ppr_ctx :: NamePprCtx , ds_msgs :: IORef (Messages DsMessage) -- Diagnostic messages , ds_if_env :: (IfGblEnv, IfLclEnv) -- Used for looking up global, ===================================== compiler/GHC/Iface/Load.hs ===================================== @@ -155,7 +155,7 @@ import qualified GHC.Unit.Home.Graph as HUG ********************************************************************* -} data KnownKeyNameSource - = KKNS_InScope GlobalRdrEnv + = KKNS_InScope Module GlobalRdrEnv TypeEnv -- Look up the known-key name in this GlobalRdrEnv, which -- is the top-level scope of the current module. -- This happens when -frebindable-known-key-name is set, usually when @@ -167,17 +167,17 @@ data KnownKeyNameSource -- is /not/ set instance Outputable KnownKeyNameSource where - ppr KKNS_FromModule = text "FromModule" - ppr (KKNS_InScope env) = text "InScope" <> braces (ppr env) + ppr KKNS_FromModule = text "FromModule" + ppr (KKNS_InScope mod rdr_env type_env) = text "InScope" <> braces (ppr rdr_env) lookupKnownKeyThing :: HasDebugCallStack => KnownKey -> KnownKeyNameSource -> IfM lcl (MaybeErr IfaceMessage TyThing) -lookupKnownKeyThing key mb_gbl_rdr_env - = do { mb_name <- lookupKnownKeyName key mb_gbl_rdr_env +lookupKnownKeyThing key kk_ns + = do { mb_name <- lookupKnownKeyName key kk_ns ; case mb_name of Failed err -> return (Failed err) - Succeeded name -> lookupGlobalName name } + Succeeded name -> lookupKnownName kk_ns name } lookupKnownKeyName :: HasDebugCallStack => KnownKey -> KnownKeyNameSource @@ -199,7 +199,7 @@ lookupKnownKeyName key KKNS_FromModule | otherwise -> return (Failed (MissingKnownKey1 key)) } -lookupKnownKeyName key (KKNS_InScope gbl_rdr_env) +lookupKnownKeyName key (KKNS_InScope _ gbl_rdr_env _) -- Just gbl_rdr_env: we have -frebindable-known-key-names on, and -- here is the top-level GlobalRdrEnv -- Look up the /un-qualified/ known-key OccName in the GlobalRdrEnv @@ -238,11 +238,11 @@ lookupKnownGRE rdr_env occ lookupKnownOccThing :: HasDebugCallStack => KnownOcc -> KnownKeyNameSource -> IfM lcl (MaybeErr IfaceMessage TyThing) -lookupKnownOccThing occ mb_gbl_rdr_env - = do { mb_name <- lookupKnownOccName occ mb_gbl_rdr_env +lookupKnownOccThing occ kk_ns + = do { mb_name <- lookupKnownOccName occ kk_ns ; case mb_name of Failed err -> return (Failed err) - Succeeded name -> lookupGlobalName name } + Succeeded name -> lookupKnownName kk_ns name } lookupKnownOccName :: HasDebugCallStack => KnownOcc -> KnownKeyNameSource @@ -253,7 +253,7 @@ lookupKnownOccName occ KKNS_FromModule Just name -> return (Succeeded name) Nothing -> return (Failed (MissingKnownKey3 occ)) } -lookupKnownOccName occ (KKNS_InScope gbl_rdr_env) +lookupKnownOccName occ (KKNS_InScope _ gbl_rdr_env _) -- Just gbl_rdr_env: we have -frebindable-known-key-names on, and -- here is the top-level GlobalRdrEnv -- Look up the /un-qualified/ known-key OccName in the GlobalRdrEnv @@ -265,6 +265,24 @@ lookupKnownOccName occ (KKNS_InScope gbl_rdr_env) ; return (Succeeded name) } Failed err -> return (Failed err) +lookupKnownName :: HasDebugCallStack + => KnownKeyNameSource -> Name + -> IfM lcl (MaybeErr IfaceMessage TyThing) +-- Go from a known Name to its TyThing +-- If we are in KKNS_InScope, look up in the current module's type environment +-- in case it is defined right here in this module rather than imported +lookupKnownName kk_ns name + = case kk_ns of + KKNS_InScope this_mod _ type_env + | name_mod == this_mod + -> case lookupTypeEnv type_env name of + Just thing -> return (Succeeded thing) + Nothing -> return (Failed ...) + + _ -> loadGlobalName name name_mod + where + name_mod = nameModule name + loadKnownKeyOccMaps :: IfM lcl KnownKeyNameMaps loadKnownKeyOccMaps = do { eps <- getEps @@ -331,16 +349,12 @@ checkKnownKeyNamesIface known_key_names_occ_map * * ********************************************************************* -} -lookupGlobalName :: HasDebugCallStack - => Name -> IfM lcl (MaybeErr IfaceMessage TyThing) --- Only works for External Names that have a Module -lookupGlobalName name = loadGlobalName name (nameModule name) - loadGlobalName :: forall lcl. HasDebugCallStack => Name -> Module -- Use this for non-External Names (maybe Backpack-related?) -> IfM lcl (MaybeErr IfaceMessage TyThing) +-- Only works for External Names that have a Module loadGlobalName name mod = do { env <- getGblEnv ; case lookupKnotVars (if_rec_types env) mod of @@ -357,7 +371,7 @@ loadGlobalName name mod ; via_external } } - _ -> do { traceIf (text "loadGlobalName4" <+> ppr name) + _ -> do { traceIf (text "loadGlobalName4" <+> ppr name $$ ppr (if_rec_types env) $$ text "stack" <+> callStackDoc) ; via_external } } where via_external = do { hsc_env <- getTopEnv ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -1049,7 +1049,7 @@ lookup_known_occ KKNS_FromModule occ Just name -> return (Succeeded name) Nothing -> return (Failed (MissingKnownKey3 occ)) } -lookup_known_occ (KKNS_InScope gbl_rdr_env) occ +lookup_known_occ (KKNS_InScope _ gbl_rdr_env _) occ = case lookupKnownGRE gbl_rdr_env occ of Succeeded gre -> do { addUsedGRE NoDeprecationWarnings gre ; let name = greName gre ===================================== compiler/GHC/Tc/Instance/Typeable.hs ===================================== @@ -51,6 +51,7 @@ import GHC.Driver.DynFlags import GHC.Utils.Fingerprint(Fingerprint(..), fingerprintString, fingerprintFingerprints) import GHC.Utils.Outputable import GHC.Utils.Panic +import GHC.Utils.Misc import GHC.Data.FastString ( FastString, mkFastString, fsLit ) import Control.Monad.Trans.State.Strict @@ -316,7 +317,7 @@ We use it in: -- 'tcRnSrcDecls'. -- -- See Note [Grand plan for Typeable] in "GHC.Tc.Instance.Typeable". -mkTypeableBinds :: TcM TcGblEnv +mkTypeableBinds :: HasDebugCallStack => TcM TcGblEnv mkTypeableBinds = do { dflags <- getDynFlags ; tcg_env <- getGblEnv @@ -324,6 +325,8 @@ mkTypeableBinds tycons_that_need = filter tc_needs_typeable (tcg_tcs tcg_env) -- These tycons will need some typeable bindings + ; traceTc "mkTypableBinds" (ppr this_mod $$ ppr tycons_that_need $$ callStackDoc) + -- Stop now if we don't need any typable bindings -- See (GPT8) in Note [Grand plan for Typeable] ; if no_typeable_binds_needed dflags this_mod tycons_that_need ===================================== compiler/GHC/Tc/Module.hs ===================================== @@ -332,13 +332,17 @@ tcRnModuleTcRnM hsc_env mod_sum ; whenM (goptM Opt_DoCoreLinting) $ lintGblEnv (hsc_logger hsc_env) (hsc_dflags hsc_env) tcg_env + -- Sync the knot-tied type environment before checking + -- the M.hi-boot interface, if any + ; syncTypeEnvKnotVars tcg_env + ; setGblEnv tcg_env $ do { -- Compare hi-boot iface (if any) with the real thing -- Must be done after processing the exports tcg_env <- checkHiBootIface tcg_env boot_info ; -- The new type env is already available to stuff - -- slurped from interface files, via - -- GHC.Tc.Utils.Env.setGlobalTypeEnv. It's important that this + -- slurped from interface files, via syncTypeEnvKnotVars, + -- itself called by tcRnSrcDecls. It's important that this -- includes the stuff in checkHiBootIface, -- because the latter might add new bindings for -- boot_dfuns, which may be mentioned in imported @@ -553,6 +557,7 @@ tcRnSrcDecls :: Bool -- False => no 'module M(..) where' header at all tcRnSrcDecls explicit_mod_hdr export_ies decls = do { -- Do all the declarations ; (tcg_env, tcl_env, lie) <- tc_rn_src_decls decls + ; traceTc "tcRnSrcDecls" (ppr (tcg_type_env tcg_env)) ------ Simplify constraints --------- -- @@ -570,7 +575,13 @@ tcRnSrcDecls explicit_mod_hdr export_ies decls ; ev_binds <- simplifyTop (lie `andWC` lie_main) ; return (tcg_env `addEvBinds` ev_binds) } + -- Update the knot-tied type environment to include everything + -- bound in this module. Do this now because when compiling GHC.Internal.Types, + -- mkTypeableBinds needs to "see" the definition of `Module` + ; syncTypeEnvKnotVars tcg_env + -- Emit Typeable bindings + ; traceTc "Before mkTypeableBinds" (ppr (tcg_type_env tcg_env)) ; tcg_env <- setGblEnv tcg_env $ mkTypeableBinds @@ -643,15 +654,15 @@ tcRnSrcDecls explicit_mod_hdr export_ies decls -- to the previous tcg_env ; tcg_env' = tcg_env - { tcg_binds = binds' ++ binds_mf + { tcg_type_env = final_type_env + , tcg_binds = binds' ++ binds_mf , tcg_ev_binds = ev_binds' `unionBags` ev_binds_mf , tcg_imp_specs = imp_specs' ++ imp_specs_mf , tcg_rules = rules' ++ rules_mf , tcg_fords = fords' ++ fords_mf , tcg_patsyns = pat_syns' ++ patsyns_mf } } ; - ; setGlobalTypeEnv tcg_env' final_type_env - } + ; return tcg_env' } zonkTcGblEnv :: TcGblEnv -> TcM (TypeEnv, Bag EvBind, LHsBinds GhcTc, @@ -710,6 +721,7 @@ tc_rn_src_decls ds ; (tcg_env, rn_decls) <- rnTopSrcDecls first_group -- rnTopSrcDecls fails if there are any errors + ; traceRn "tc_rn_src_decls 77" empty -- Get TH-generated top-level declarations and make sure they don't -- contain any splices since we don't handle that at the moment -- @@ -730,8 +742,8 @@ tc_rn_src_decls ds AddTopDeclsUnexpectedDeclarationSplice } -- Rename TH-generated top-level declarations - ; (tcg_env, th_rn_decls) <- setGblEnv tcg_env - $ rnTopSrcDecls th_group + ; (tcg_env, th_rn_decls) <- setGblEnv tcg_env + $ rnTopSrcDecls th_group -- Dump generated top-level declarations ; let msg = "top-level declarations added with 'addTopDecls'" @@ -747,6 +759,7 @@ tc_rn_src_decls ds -- NB: set the env **before** captureTopConstraints so that error messages -- get reported w.r.t. the right GlobalRdrEnv. It is for this reason that -- the captureTopConstraints must go here, not in tcRnSrcDecls. + ; traceRn "about to typechecke decls" (ppr rn_decls) ; ((tcg_env, tcl_env), lie1) <- setGblEnv tcg_env $ captureTopConstraints $ tcTopSrcDecls rn_decls @@ -834,10 +847,11 @@ tcRnHsBootDecls boot_or_sig decls ; let { type_env0 = tcg_type_env gbl_env ; type_env1 = extendTypeEnvWithIds type_env0 val_ids ; type_env2 = extendTypeEnvWithIds type_env1 dfun_ids - ; dfun_ids = map iDFunId inst_infos + ; dfun_ids = map iDFunId inst_infos + ; gbl_env' = gbl_env { tcg_type_env = type_env2 } } - ; setGlobalTypeEnv gbl_env type_env2 + ; return gbl_env' }}} ; traceTc "boot" (ppr lie); return gbl_env } @@ -875,20 +889,14 @@ checkHiBootIface tcg_env boot_info -- -- to (a) the type envt, and (b) the top-level bindings ; let boot_impedance_bds = map fst imp_prs - type_env' = extendTypeEnvWithIds local_type_env boot_impedance_bds + !type_env' = extendTypeEnvWithIds local_type_env boot_impedance_bds impedance_binds = [ mkVarBind boot_id (nlHsVar id) | (boot_id, id) <- imp_prs ] tcg_env_w_binds - = tcg_env { tcg_binds = binds ++ impedance_binds } + = tcg_env { tcg_type_env = type_env' + , tcg_binds = binds ++ impedance_binds } - ; type_env' `seq` - -- Why the seq? Without, we will put a TypeEnv thunk in - -- tcg_type_env_var. That thunk will eventually get - -- forced if we are typechecking interfaces, but that - -- is no good if we are trying to typecheck the very - -- DFun we were going to put in. - -- TODO: Maybe setGlobalTypeEnv should be strict. - setGlobalTypeEnv tcg_env_w_binds type_env' } + ; return tcg_env_w_binds } {- Note [DFun impedance matching] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -978,7 +986,7 @@ This most works well, but there is one problem: DFuns! We do not want to look at the mb_insts of the ModDetails in SelfBootInfo, because a dfun in one of those ClsInsts is gotten (in GHC.IfaceToCore.tcIfaceInst) by a (lazily evaluated) lookup in the if_rec_types. We could extend the -type env, do a setGloblaTypeEnv etc; but that all seems very indirect. +type env, do a syncTypeEnvKnotVars etc; but that all seems very indirect. It is much more directly simply to extract the DFunIds from the md_types of the SelfBootInfo. ===================================== compiler/GHC/Tc/Types.hs ===================================== @@ -487,7 +487,7 @@ data TcGblEnv -- NB: for what "things in this module" means, see -- Note [The interactive package] in "GHC.Runtime.Context" - tcg_type_env_var :: KnotVars (IORef TypeEnv), + tcg_knot_vars :: KnotVars (IORef TypeEnv), -- Used only to initialise the interface-file -- typechecker in initIfaceTcRn, so that it can see stuff -- bound in this module when dealing with hi-boot recursions ===================================== compiler/GHC/Tc/Utils/Backpack.hs ===================================== @@ -739,7 +739,7 @@ mergeSignatures , rdr_elt <- lookupGRE rdr_env (LookupOccName occ AllRelevantGREs) ] -- STEP 5: Typecheck the interfaces - let type_env_var = tcg_type_env_var tcg_env + let knot_type_env = tcg_knot_vars tcg_env -- typecheckIfacesForMerging does two things: -- 1. It merges the all of the ifaces together, and typechecks the @@ -748,7 +748,7 @@ mergeSignatures -- resolving to the merged type_env from (1). -- See typecheckIfacesForMerging for more details. (type_env, detailss) <- initIfaceTcRn $ - typecheckIfacesForMerging inner_mod ifaces type_env_var + typecheckIfacesForMerging inner_mod ifaces knot_type_env let infos = zip ifaces detailss -- Test for cycles @@ -764,7 +764,7 @@ mergeSignatures -- NB: Why do we set tcg_tcs/tcg_patsyns/tcg_type_env directly, -- rather than use tcExtendGlobalEnv (the normal method to add newly -- defined types to TcGblEnv?) tcExtendGlobalEnv adds these - -- TyThings to 'tcg_type_env_var', which is consulted when + -- TyThings to 'tcg_knot_vars', which is consulted when -- we read in interfaces to tie the knot. But *these TyThings themselves -- come from interface*, so that would result in deadlock. Don't -- update it! ===================================== compiler/GHC/Tc/Utils/Env.hs ===================================== @@ -16,7 +16,7 @@ module GHC.Tc.Utils.Env( -- Global environment tcExtendGlobalEnv, tcExtendTyConEnv, - tcExtendGlobalEnvImplicit, setGlobalTypeEnv, + tcExtendGlobalEnvImplicit, syncTypeEnvKnotVars, tcExtendGlobalValEnv, tcTyThBinders, tcLookupLocatedGlobal, tcLookupGlobal, tcLookupGlobalOnly, tcLookupTyCon, tcLookupClass, @@ -515,8 +515,10 @@ getKnownKeySource :: TcRn KnownKeyNameSource getKnownKeySource = do { rebindable_path <- goptM Opt_RebindableKnownKeyNames ; if rebindable_path - then do { rdr_env <- getGlobalRdrEnv - ; return (KKNS_InScope rdr_env) } + then do { env <- getGlobalEnv + ; return (KKNS_InScope (tcg_mod env) + (tcg_rdr_env env) + (tcg_type_env env)) } else return KKNS_FromModule } tcrn_wrapper :: HasDebugCallStack @@ -606,16 +608,21 @@ get_id do_the_lookup ************************************************************************ -} -setGlobalTypeEnv :: TcGblEnv -> TypeEnv -> TcM TcGblEnv --- Use this to update the global type env --- It updates both * the normal tcg_type_env field --- * the tcg_type_env_var field seen by interface files -setGlobalTypeEnv tcg_env new_type_env - = do { -- Sync the type-envt variable seen by interface files - ; case lookupKnotVars (tcg_type_env_var tcg_env) (tcg_mod tcg_env) of - Just tcg_env_var -> writeMutVar tcg_env_var new_type_env - Nothing -> return () - ; return (tcg_env { tcg_type_env = new_type_env }) } +syncTypeEnvKnotVars :: TcGblEnv -> TcM () +-- Use this to sync the tcg_knot_vars with the current type env +-- so that interface-file and known-key/occ lookups will find the +-- current bindings +-- +-- Why the "!" before writing it into the variable? Without, we will put +-- a TypeEnv thunk into the knot-tied variable. That thunk will eventually get +-- forced if we are typechecking interfaces, but that is no good if we are +-- trying to typecheck the very DFun we were going to put in. +syncTypeEnvKnotVars tcg_env + = case lookupKnotVars (tcg_knot_vars tcg_env) (tcg_mod tcg_env) of + Just tcg_env_var -> do { let !type_env = tcg_type_env tcg_env + -- Why the "!"? See comment on the function + ; writeMutVar tcg_env_var type_env } + Nothing -> return () tcExtendGlobalEnvImplicit :: [TyThing] -> TcM r -> TcM r @@ -623,8 +630,9 @@ tcExtendGlobalEnvImplicit :: [TyThing] -> TcM r -> TcM r -- Do not extend tcg_tcs, tcg_patsyns etc tcExtendGlobalEnvImplicit things thing_inside = do { tcg_env <- getGblEnv - ; let ge' = extendTypeEnvList (tcg_type_env tcg_env) things - ; tcg_env' <- setGlobalTypeEnv tcg_env ge' + ; let !type_env' = extendTypeEnvList (tcg_type_env tcg_env) things + tcg_env' = tcg_env { tcg_type_env = type_env' } + ; syncTypeEnvKnotVars tcg_env' ; setGblEnv tcg_env' thing_inside } tcExtendGlobalEnv :: [TyThing] -> TcM r -> TcM r @@ -677,8 +685,8 @@ tcExtendRecEnv gbl_stuff thing_inside = do { tcg_env <- getGblEnv ; let ge' = extendNameEnvList (tcg_type_env tcg_env) gbl_stuff tcg_env' = tcg_env { tcg_type_env = ge' } - -- No need for setGlobalTypeEnv (which side-effects the - -- tcg_type_env_var); tcExtendRecEnv is used just + -- No need for syncTypeEnvKnotVars (which side-effects the + -- tcg_knot_vars); tcExtendRecEnv is used just -- when kind-check a group of type/class decls. It would -- in any case be wrong for an interface-file decl to end up -- with a TcTyCon in it! ===================================== compiler/GHC/Tc/Utils/Monad.hs ===================================== @@ -353,7 +353,7 @@ initTcGblEnv hsc_env hsc_src keep_rn_syntax mod loc = , tcg_default = emptyDefaultEnv , tcg_default_exports = emptyDefaultEnv , tcg_type_env = emptyNameEnv - , tcg_type_env_var = hsc_type_env_vars hsc_env + , tcg_knot_vars = hsc_type_env_vars hsc_env , tcg_inst_env = emptyInstEnv , tcg_fam_inst_env = emptyFamInstEnv , tcg_ann_env = emptyAnnEnv @@ -2404,7 +2404,7 @@ initIfaceTcRn thing_inside ; hsc_env <- getTopEnv -- bangs to avoid leaking the envs (#19356) ; let !mhome_unit = hsc_home_unit_maybe hsc_env - !knot_vars = tcg_type_env_var tcg_env + !knot_vars = tcg_knot_vars tcg_env -- When we are instantiating a signature, -- we DEFINITELY do not want to knot tie. is_instantiate = fromMaybe False (isHomeUnitInstantiating <$> mhome_unit) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/eae15e45a0251b349fa32e359ef6f67e... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/eae15e45a0251b349fa32e359ef6f67e... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Simon Peyton Jones (@simonpj)