import RnEnv ( availName, availsToNameSet,
emptyAvailEnv, unitAvailEnv, availEnvElts, plusAvailEnv,
warnUnusedImports, warnUnusedLocalBinds, warnUnusedModules,
- lookupImplicitOccsRn, unknownNameErr,
+ lookupOrigNames, unknownNameErr,
FreeVars, plusFVs, plusFV, unitFV, emptyFVs, isEmptyFVs, addOneFV
)
import Module ( Module, ModuleName, WhereFrom(..),
= -- Initialise the renamer monad
do {
((maybe_rn_stuff, dump_action), rn_errs_bag, rn_warns_bag)
- <- initRn mod_name us (mkSearchPath opt_HiMap) loc (rename this_mod) ;
+ <- initRn (mkThisModule mod_name) us
+ (mkSearchPath opt_HiMap) loc
+ (rename this_mod) ;
-- Check for warnings
printErrorsAndWarnings rn_errs_bag rn_warns_bag ;
\begin{code}
implicitFVs mod_name decls
- = lookupImplicitOccsRn implicit_occs `thenRn` \ implicit_names ->
+ = lookupOrigNames implicit_occs `thenRn` \ implicit_names ->
returnRn (mkNameSet (map getName default_tycons) `plusFV`
implicit_names)
where
`addOneToNameSet` cls)
`plusFV` maybe_double
where
- get (ClassOpSig n _ _ ty _)
+ get (ClassOpSig n _ ty _)
| n `elemNameSet` source_fvs = extractHsTyNames ty
| otherwise = emptyFVs
-- import This. Sigh.
-- There's really no good way to detect this, so the error message
-- in RnEnv.warnUnusedModules is weakened instead
- inst_mods = [m | InstD (InstDecl _ _ _ dfun _) <- imported_decls,
+ inst_mods = [m | InstD (InstDecl _ _ _ (Just dfun) _) <- imported_decls,
let m = moduleName (nameModule dfun),
m `elem` direct_import_mods
]