summaryrefslogtreecommitdiff
path: root/ghc/compiler/rename
diff options
context:
space:
mode:
authorsimonpj <unknown>2000-12-07 10:06:20 +0000
committersimonpj <unknown>2000-12-07 10:06:20 +0000
commit16d403da35bf16ee7f54e1a5ec0e86513d757126 (patch)
tree4cc052f73f694ee95445d46074e57f40d936420f /ghc/compiler/rename
parent0b62f53e6da34769aa1bf8409d9987a5311bb516 (diff)
downloadhaskell-16d403da35bf16ee7f54e1a5ec0e86513d757126.tar.gz
[project @ 2000-12-07 10:06:20 by simonpj]
Dont warn about uses of deprecated things in its own module
Diffstat (limited to 'ghc/compiler/rename')
-rw-r--r--ghc/compiler/rename/Rename.lhs16
1 files changed, 10 insertions, 6 deletions
diff --git a/ghc/compiler/rename/Rename.lhs b/ghc/compiler/rename/Rename.lhs
index 8dbd8a2ed5..7a3ae9a3d1 100644
--- a/ghc/compiler/rename/Rename.lhs
+++ b/ghc/compiler/rename/Rename.lhs
@@ -772,22 +772,26 @@ warnDeprecations this_mod export_avails my_deprecs used_names
pit = iPIT ifaces
deprecs = [ (n,txt)
| n <- nameSetToList used_names,
+ not (nameIsLocalOrFrom this_mod n),
Just txt <- [lookup_deprec hit pit n] ]
+ -- nameIsLocalOrFrom: don't complain about locally defined names
+ -- For a start, we may be exporting a deprecated thing
+ -- Also we may use a deprecated thing in the defn of another
+ -- deprecated things. We may even use a deprecated thing in
+ -- the defn of a non-deprecated thing, when changing a module's
+ -- interface
in
mapRn_ warnDeprec deprecs
where
- export_mods = nub [ moduleName (nameModule name)
+ export_mods = nub [ moduleName mod
| avail <- export_avails,
- let name = availName avail,
- not (nameIsLocalOrFrom this_mod name) ]
+ let mod = nameModule (availName avail),
+ mod /= this_mod ]
load_home m = loadInterface (text "Check deprecations for" <+> ppr m) m ImportBySystem
lookup_deprec hit pit n
- | nameIsLocalOrFrom this_mod n
- = lookupDeprec my_deprecs n
- | otherwise
= case lookupIface hit pit n of
Just iface -> lookupDeprec (mi_deprecs iface) n
Nothing -> pprPanic "warnDeprecations:" (ppr n)