-- thing (especially via 'module Foo' export item)
-- That is, only uses in the *body* of the module are complained about
traceRn (text "rn3") ;
- failIfErrsM ; -- finishDeprecations crashes sometimes
+ failIfErrsM ; -- finishWarnings crashes sometimes
-- as a result of typechecker repairs (e.g. unboundNames)
- tcg_env <- finishDeprecations (hsc_dflags hsc_env) mod_deprec tcg_env ;
+ tcg_env <- finishWarnings (hsc_dflags hsc_env) mod_deprec tcg_env ;
-- Process the export list
traceRn (text "rn4a: before exports");
-- Stubs
mg_rdr_env = emptyGlobalRdrEnv,
mg_fix_env = emptyFixityEnv,
- mg_deprecs = NoDeprecs,
+ mg_warns = NoWarnings,
mg_foreign = NoStubs,
mg_hpc_info = emptyHpcInfo False,
mg_modBreaks = emptyModBreaks,
where
mod = tcg_mod tcg_env
main_mod = mainModIs dflags
- main_is_flag = mainFunIs dflags
-
- main_fn = case main_is_flag of
- Just fn -> mkRdrUnqual (mkVarOccFS (mkFastString fn))
- Nothing -> main_RDR_Unqual
+ main_fn = getMainFun dflags
complain_no_main | ghcLink dflags == LinkInMemory = return ()
| otherwise = failWithTc noMainMsg
mainCtxt = ptext (sLit "When checking the type of the") <+> pp_main_fn
noMainMsg = ptext (sLit "The") <+> pp_main_fn
<+> ptext (sLit "is not defined in module") <+> quotes (ppr main_mod)
- pp_main_fn | isJust main_is_flag = ptext (sLit "main function") <+> quotes (ppr main_fn)
- | otherwise = ptext (sLit "function") <+> quotes (ppr main_fn)
+ pp_main_fn | main_fn == main_RDR_Unqual = ptext (sLit "function") <+> quotes (ppr main_fn)
+ | otherwise = ptext (sLit "main function") <+> quotes (ppr main_fn)
+
\end{code}
Note [Root-main Id]