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

GHC trac at galois.com
Mon Mar 31 13:28:30 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 Eelis-):

 Hm, I'm confused. Maybe my testcase was bad, because it might've suggested
 that the warning was simply a consequence of b being unused. Here's a
 better testcase:
 {{{
   import List
   import Prelude

   main = do
     l <- getLine
     print $ List.null l
 }}}
 Here there can be absolutely no doubt that List.null is used, yet still
 GHC warns that nothing from List is used. Furthermore, the warning goes
 away if the "import Prelude" line is removed or if the two import lines
 are reversed. It seems to me that this can only be considered a genuine
 bug, not a reasonable consequence of any particular design choice.

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


More information about the Glasgow-haskell-bugs mailing list