#2681: Incorrect imported module not used warning
---------------------------------+------------------------------------------
    Reporter:  NeilMitchell      |       Owner:                  
        Type:  bug               |      Status:  new             
    Priority:  normal            |   Component:  Compiler        
     Version:  6.9               |    Severity:  normal          
    Keywords:                    |    Testcase:                  
Architecture:  Unknown/Multiple  |          Os:  Unknown/Multiple
---------------------------------+------------------------------------------
 A test case, with 3 files in.

 {{{
 -- AAA.hs
 module AAA where
 data Foo = Foo

 -- AA.hs
 module AA(Foo) where
 import AAA

 -- A.hs
 module A where
 import qualified AA
 import AAA
 type Bar = AA.Foo
 }}}

 Trying it out gives:

 {{{
 $ ghc --make
 [3 of 3] Compiling A                ( A.hs, A.o )
 A.hs:2:0:
     Warning: Module `AA' is imported, but nothing from it is used,
                except perhaps instances visible in `AA'
              To suppress this warning, use: import AA()
 }}}

 {{{Foo}}} comes from {{{AAA}}}, but is used with the import from {{{AA}}},
 so it should be saying {{{AAA} is imported but not used. It seems the
 import warnings are based on final fully resolved names, but this doesn't
 deal with re-exports or qualification correctly.

 I came accross this test case while tracking down a much more complex
 example which gave a case where an unqualified module was reported as
 being redundant - despite the fact that it was required - so it seems
 there are several bugs around this area.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2681>
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

Reply via email to