Don't warn if 'import Prelude' doesn't import anything
authorSimon Marlow <marlowsd@gmail.com>
Tue, 5 Aug 2008 13:37:02 +0000 (13:37 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Tue, 5 Aug 2008 13:37:02 +0000 (13:37 +0000)
... even if Prelude doesn't come from the base package (it might come from
a old backwards-compatible version of base, for example).

compiler/rename/RnNames.lhs

index e629dac..f29b06f 100644 (file)
@@ -1198,7 +1198,10 @@ reportUnusedNames export_decls gbl_env
                       (_, no_imp, loc) <- xs,
                       let mod_name = moduleName mod,
                       not (mod_name `elemFM` minimal_imports1),
-                      mod /= pRELUDE,
+                      moduleName mod /= pRELUDE_NAME,
+                             -- XXX not really correct, but we don't want
+                             -- to generate warnings when compiling against
+                             -- a compat version of base.
                       not no_imp]
        -- The not no_imp part is not to complain about
        -- import M (), which is an idiom for importing