[GHC] #1148: Bad warnings about unused imports that are in fact needed

GHC trac at galois.com
Thu Mar 27 06:00:52 EDT 2008


#1148: Bad warnings about unused imports that are in fact needed
-----------------------------------+----------------------------------------
 Reporter:  brianh                 |          Owner:         
     Type:  bug                    |         Status:  new    
 Priority:  lowest                 |      Milestone:  _|_    
Component:  Compiler               |        Version:  6.8.2  
 Severity:  trivial                |     Resolution:         
 Keywords:  warning unused import  |     Difficulty:  Unknown
 Testcase:                         |   Architecture:  x86    
       Os:  Windows                |  
-----------------------------------+----------------------------------------
Comment (by simonpj):

 This is actually a slightly different issue to the one that started this
 ticket.  Consider
 {{{
 module Foo(x) where
   import List(null)
   x = 3
   y1 = null
   y2 = y1
   y3 = y2
 }}}
 What would you like?

   * Report `y3` unused, only.  The trouble here is that when you delete
 `y3` you now get a new warning that `y2` is unused.  And so on.

   * Report `y3,y2,y1,null` all unused?  This gets them all in one one go,
 but if you don't respond to them all (e.g. you delete only `y1`), the
 module won't compile.  And currently different flags affect unused (a)
 imports and (b) local bindings, so GHC might report `null` unused, but not
 `y3,y2,y1`.

 It's not clear what the best design is. Currently GHC follows the latter,
 but I'm open to suggestions.

 Simon

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


More information about the Glasgow-haskell-bugs mailing list