[GHC] #3419: Incorrect "unnecessary import" warning

GHC trac at galois.com
Thu Aug 6 11:59:54 EDT 2009


#3419: Incorrect "unnecessary import" warning
-----------------------------+----------------------------------------------
Reporter:  NeilMitchell      |          Owner:                  
    Type:  bug               |         Status:  new             
Priority:  normal            |      Component:  Compiler        
 Version:  6.10.4            |       Severity:  normal          
Keywords:                    |       Testcase:                  
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
-----------------------------+----------------------------------------------
 With the code:

 {{{
 {-# OPTIONS_GHC -Wall -fno-warn-missing-methods #-}
 module Test where
 import Data.Typeable
 import Data.Data
 data Test = Test
 instance Typeable Test where
 }}}

 I get the warning:

 {{{
     Warning: Module `Data.Typeable' is imported, but nothing from it is
 used
                except perhaps instances visible in `Data.Typeable'
              To suppress this warning, use: import Data.Typeable()
 }}}

 It seems like it's decided to pick up Typeable from Data.Data, but it's
 also available from Data.Typeable which would be a better choice. I'm not
 sure how this should be solved, but the current behaviour seems incorrect.
 Perhaps if two modules are imported, both of which export the same thing,
 they should both be allowed.

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


More information about the Glasgow-haskell-bugs mailing list