Ticket #5860 (closed feature request: fixed)
Ambiguity between redundant imports
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?