diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-08-22 13:34:43 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-08-22 13:34:43 -0700 |
commit | 1f75440fc7e4577190d98c0f4643d54d9c934540 (patch) | |
tree | f7b213f6e7c6bf6d39193892c487293ee171d4f1 | |
parent | fb0d87f1c4a35fa2aaf7f6dd55edbc71c7c3b44d (diff) | |
download | haskell-1f75440fc7e4577190d98c0f4643d54d9c934540.tar.gz |
Extra comments, as per SPJ in #12035.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
-rw-r--r-- | compiler/iface/TcIface.hs | 4 | ||||
-rw-r--r-- | compiler/main/GhcMake.hs | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/compiler/iface/TcIface.hs b/compiler/iface/TcIface.hs index fa8e26ae5e..5b31b7a46d 100644 --- a/compiler/iface/TcIface.hs +++ b/compiler/iface/TcIface.hs @@ -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 diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs index d67a12061b..bb1c8e3f2d 100644 --- a/compiler/main/GhcMake.hs +++ b/compiler/main/GhcMake.hs @@ -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 |