Commit 1f75440f authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Extra comments, as per SPJ in #12035.


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent fb0d87f1
......@@ -1421,6 +1421,10 @@ ifKnotErr name env_doc type_env = vcat
-- * Note [Knot-tying typecheckIface]
-- * Note [DFun knot-tying]
-- * Note [hsc_type_env_var hack]
--
-- There is also a wiki page on the subject, see:
--
-- https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/TyingTheKnot
tcIfaceTyConByName :: IfExtName -> IfL TyCon
tcIfaceTyConByName name
......
......@@ -1049,6 +1049,8 @@ parUpsweep_one mod home_mod_map comp_graph_loops lcl_dflags cleanup par_sem
let lcl_hsc_env = localize_hsc_env hsc_env
-- Re-typecheck the loop
-- This is necessary to make sure the knot is tied when
-- we close a recursive module loop, see bug #12035.
type_env_var <- liftIO $ newIORef emptyNameEnv
let lcl_hsc_env' = lcl_hsc_env { hsc_type_env_var =
Just (ms_mod lcl_mod, type_env_var) }
......@@ -1158,7 +1160,8 @@ upsweep old_hpt stable_mods cleanup sccs = do
-- Lazily reload the HPT modules participating in the loop.
-- See Note [Tying the knot]--if we don't throw out the old HPT
-- and reinitalize the knot-tying process, anything that was forced
-- while we were previously typechecking won't get updated.
-- while we were previously typechecking won't get updated, this
-- was bug #12035.
hsc_env2 <- liftIO $ reTypecheckLoop hsc_env1 mod done
setSession hsc_env2
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment