#1074: -fwarn-unused-imports complains about wrong import
-------------------------+--------------------------------------------------
Reporter: guest | Owner:
Type: bug | Status: new
Priority: normal | Milestone: _|_
Component: Compiler | Version: 6.6
Severity: minor | Resolution:
Keywords: | Difficulty: Unknown
Os: MacOS X | Testcase:
Architecture: powerpc |
-------------------------+--------------------------------------------------
Comment (by Isaac Dupree):
I think this is the same bug, that I ran into:
{{{
module Foo where
import qualified Prelude as A (take)
import qualified Prelude as B
}}}
{{{Warning: Imported from `Prelude' but not used: `B.take'}}}
The module it refers to is the last applicable one in the import list -
even if there would never be a warning about importing a particular
identifier when it is not explicitly named in a relevant import list, and
even if B.somethingElse is used. Re-ordering the imports "fixes" the
warning; also, adding {{{...as B hiding (take)}}} "fixes" it. Maybe this
bit is fixable, assuming ghc remembers the `import` lines...
Also I noticed that replacing `take` with `Int` results in no warning at
all - is this intentional? (note that, apparently GHC *never* gives
unused-*module*-import warnings for Prelude, if considering this)
P.S. if {{{"necessary" means:
If you remove that import statement, then the module cannot be
compiled.}}}
then GHC is designed (whether or not I agree with that design) to warn
about those, when the only uses of that import are by function definitions
that are never used or exported.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1074>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs