-mkModDeps :: [(ModuleName, IsBootInterface)]
- -> ModuleEnv (ModuleName, IsBootInterface)
-mkModDeps deps = foldl add emptyModuleEnv deps
- where
- add env elt@(m,_) = extendModuleEnvByName env m elt
+exportsToAvails :: [IfaceExport] -> TcRnIf gbl lcl Avails
+exportsToAvails exports
+ = do { avails_by_module <- mappM do_one exports
+ ; return (concat avails_by_module) }
+ where
+ do_one (mod_name, exports) = mapM (do_avail mod_name) exports
+ do_avail mod (Avail n) = do { n' <- lookupOrig mod n;
+ ; return (Avail n') }
+ do_avail mod (AvailTC n ns) = do { n' <- lookupOrig mod n
+ ; ns' <- mappM (lookupImplicitOrig n') ns
+ ; return (AvailTC n' ns') }
+ -- Note the lookupImplicitOrig. It ensures that the subordinate names
+ -- record their parent; and that in turn ensures that the GlobalRdrEnv
+ -- has the correct parent for all the names in its range.
+ -- For imported things, we only suck in the binding site later, if ever.
+
+warnRedundantSourceImport mod_name
+ = ptext SLIT("Unnecessary {- SOURCE -} in the import of module")
+ <+> quotes (ppr mod_name)