- loadOrphanModules (imp_orphs imports) False ;
- loadOrphanModules (imp_finsts imports) True ;
-
- let { directlyImpMods = map (\(mod, _, _) -> mod)
- . moduleEnvElts
- . imp_mods
- $ imports } ;
- checkFamInstConsistency (imp_finsts imports) directlyImpMods ;
-
- traceRn (text "rn1a") ;
- -- Rename and type check the declarations
- tcg_env <- if isHsBoot hsc_src then
- tcRnHsBootDecls local_decls
- else
- tcRnSrcDecls local_decls ;
- setGblEnv tcg_env $ do {
-
- failIfErrsM ; -- reportDeprecations crashes sometimes
- -- as a result of typechecker repairs (e.g. unboundNames)
- traceRn (text "rn3") ;
-
- -- Report the use of any deprecated things
- -- We do this before processsing the export list so
- -- that we don't bleat about re-exporting a deprecated
- -- thing (especially via 'module Foo' export item)
- -- Only uses in the body of the module are complained about
- reportDeprecations (hsc_dflags hsc_env) tcg_env ;
-
- -- Process the export list
- (rn_exports, exports) <- rnExports (isJust maybe_mod) export_ies ;
-
- traceRn (text "rn4") ;
-
- -- Rename the Haddock documentation header
- rn_module_doc <- rnMbHsDoc maybe_doc ;
-
- -- Rename the Haddock module info
- rn_description <- rnMbHsDoc (hmi_description module_info) ;
- let { rn_module_info = module_info { hmi_description = rn_description } } ;
-
- -- Check whether the entire module is deprecated
- -- This happens only once per module
- let { mod_deprecs = checkModDeprec mod_deprec } ;
-
- -- Add exports and deprecations to envt
- let { final_env = tcg_env { tcg_exports = exports,
- tcg_rn_exports = if save_rn_syntax then
- rn_exports
- else Nothing,
- tcg_dus = tcg_dus tcg_env `plusDU` usesOnly (availsToNameSet exports),
- tcg_deprecs = tcg_deprecs tcg_env `plusDeprecs`
- mod_deprecs,
- tcg_doc = rn_module_doc,
- tcg_hmi = rn_module_info
- }
- -- A module deprecation over-rides the earlier ones
- } ;
-
- -- Report unused names
- reportUnusedNames export_ies final_env ;
-
- -- Dump output and return
- tcDump final_env ;
- return final_env
- }}}}
+ ; loadOrphanModules (imp_orphs imports) False
+ ; loadOrphanModules (imp_finsts imports) True
+
+ -- Check type-familily consistency
+ ; traceRn (text "rn1: checking family instance consistency")
+ ; let { dir_imp_mods = map (\ (mod, _) -> mod)
+ . moduleEnvElts
+ . imp_mods
+ $ imports }
+ ; checkFamInstConsistency (imp_finsts imports) dir_imp_mods ;
+
+ ; getGblEnv } }