#5860: Ambiguity between redundant imports
------------------------------+---------------------------------------------
 Reporter:  elliottt          |          Owner:                  
     Type:  feature request   |         Status:  new             
 Priority:  normal            |      Component:  Compiler        
  Version:  7.4.1             |       Keywords:  module system   
       Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
  Failure:  None/Unknown      |       Testcase:                  
Blockedby:                    |       Blocking:                  
  Related:                    |  
------------------------------+---------------------------------------------
 GHC reports this program:


 {{{
 module Test where

 import Data.ByteString (ByteString)
 import qualified Data.ByteString as S

 test :: ByteString -> ByteString
 test x = x
 }}}

 as having a redundant import of Data.!ByteString:

 {{{
 $ ghc -c -Wall Test.hs
 Test.hs:4:1:
     Warning: The import of `Data.ByteString' is redundant
                except perhaps to import instances from `Data.ByteString'
              To import instances alone, use: import Data.ByteString()
 }}}

 However, removing the restricted import of Data.!ByteString will cause the
 program to fail to compile, as the type is no longer available.  The real
 problem is with the qualified import of Data.!ByteString as S that is
 never referenced in the program.

 Would it be possible to change the message to distinguish between the
 qualified import an the restricted import, by more than the line number?

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