Commit f8a58611 authored by simonpj's avatar simonpj
Browse files

[project @ 2001-10-23 08:56:50 by simonpj]

Use elemRdrEnv
parent b8341ac7
......@@ -13,7 +13,8 @@ import {-# SOURCE #-} RnHiFiles
import HsSyn
import RdrHsSyn ( RdrNameIE, RdrNameHsType, extractHsTyRdrTyVars )
import RdrName ( RdrName, rdrNameModule, rdrNameOcc, isQual, isUnqual, isOrig,
mkRdrUnqual, mkRdrQual, lookupRdrEnv, foldRdrEnv, rdrEnvToList,
mkRdrUnqual, mkRdrQual,
lookupRdrEnv, foldRdrEnv, rdrEnvToList, elemRdrEnv,
unqualifyRdrName
)
import HsTypes ( hsTyVarName, replaceTyVarName )
......@@ -492,13 +493,11 @@ bindLocatedLocalsRn doc_str rdr_names_w_loc enclosed_scope
-- Warn about shadowing, but only in source modules
let
check_shadow (rdr_name,loc)
| isJust local || isJust global
| rdr_name `elemRdrEnv` local_env
|| rdr_name `elemRdrEnv` global_env
= pushSrcLocRn loc $ addWarnRn (shadowedNameWarn rdr_name)
| otherwise
= returnRn ()
where
local = lookupRdrEnv local_env rdr_name
global = lookupRdrEnv global_env rdr_name
in
(case mode of
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment