[GHC] #1074: -fwarn-unused-imports complains about wrong import

GHC trac at galois.com
Wed Jan 3 04:11:30 EST 2007


#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
 Testcase:            |   Architecture:  powerpc
       Os:  MacOS X   |  
----------------------+-----------------------------------------------------
Changes (by simonpj):

  * milestone:  => _|_
  * severity:  normal => minor

Comment:

 Good bug report.  Alas, it's not easy to fix.  Here's why.

 To report unused imports, GHC gathers up all the entities that are
 referred to (Names, in GHC's terminology).  But that doesn't say *how*
 they are referred to, so it does not distinguish 'ap' from
 'Control.Monad.ap'.

 In this case, the import of Control.Monad is indeed required, because the
 reference was a qualified one.

 So really this exposes an architectural shortcoming in the way GHC reports
 unused imports.  Of course it's fixable, but it'd be non-trivial, so don't
 hold your breath.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1074>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list