[project @ 2000-12-07 08:19:53 by simonpj]
authorsimonpj <unknown>
Thu, 7 Dec 2000 08:19:53 +0000 (08:19 +0000)
committersimonpj <unknown>
Thu, 7 Dec 2000 08:19:53 +0000 (08:19 +0000)
Fix the bogus -fwarn-unused-exports problem

ghc/compiler/rename/Rename.lhs

index aca2451..8dbd8a2 100644 (file)
@@ -726,7 +726,10 @@ reportUnusedNames my_mod_iface unqual imports avail_env
     minimal_imports1 = foldr add_name     minimal_imports0 defined_and_used
     minimal_imports  = foldr add_inst_mod minimal_imports1 inst_mods
     
-    add_name (n,NonLocalDef (UserImport m _ _)) acc = addToFM_C plusAvailEnv acc (moduleName (nameModule n))
+       -- We've carefully preserved the provenance so that we can
+       -- construct minimal imports that import the name by (one of)
+       -- the same route(s) as the programmer originally did.
+    add_name (n,NonLocalDef (UserImport m _ _)) acc = addToFM_C plusAvailEnv acc (moduleName m)
                                                                (unitAvailEnv (mk_avail n))
     add_name (n,other_prov)                    acc = acc