From: simonpj Date: Wed, 24 May 2000 13:36:10 +0000 (+0000) Subject: [project @ 2000-05-24 13:36:10 by simonpj] X-Git-Tag: Approximately_9120_patches~4384 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=8c84744052c06b3585b042817364d37b6a65a169;p=ghc-hetmet.git [project @ 2000-05-24 13:36:10 by simonpj] Only report shadowed names in source files (merge with 4.07) --- diff --git a/ghc/compiler/rename/RnEnv.lhs b/ghc/compiler/rename/RnEnv.lhs index a87d73c..25e895f 100644 --- a/ghc/compiler/rename/RnEnv.lhs +++ b/ghc/compiler/rename/RnEnv.lhs @@ -260,16 +260,16 @@ bindLocatedLocalsRn :: SDoc -- Documentation string for error message bindLocatedLocalsRn doc_str rdr_names_w_loc enclosed_scope = checkDupOrQualNames doc_str rdr_names_w_loc `thenRn_` + getModeRn `thenRn` \ mode -> getLocalNameEnv `thenRn` \ name_env -> - (if opt_WarnNameShadowing - then - mapRn_ (check_shadow name_env) rdr_names_w_loc - else - returnRn () + + -- Warn about shadowing, but only in source modules + (case mode of + SourceMode | opt_WarnNameShadowing -> mapRn_ (check_shadow name_env) rdr_names_w_loc + other -> returnRn () ) `thenRn_` getNameSupplyRn `thenRn` \ (us, inst_ns, cache, ipcache) -> - getModeRn `thenRn` \ mode -> let n = length rdr_names_w_loc (us', us1) = splitUniqSupply us