#4047: Incorrect unused-import warning in ghci
---------------------------------+------------------------------------------
Reporter: Berengal | Owner:
Type: bug | Status: new
Priority: normal | Component: GHCi
Version: 6.12.1 | Keywords:
Os: Unknown/Multiple | Testcase:
Architecture: Unknown/Multiple | Failure: Incorrect warning at
compile-time
---------------------------------+------------------------------------------
Try to load the following in ghci with -fwarn-unused-imports:
{{{
import Prelude hiding (zip)
zip :: [a] -> [b] -> [(a,b)]
zip _ _ = []
}}}
It spits out the usual warning for unused imports:
{{{
Warning: The import of `Prelude' is redundant
except perhaps to import instances from `Prelude'
To import instances alone, use: import Prelude()
}}}
When compiled with `ghc --make -fwarn-unused-imports` no warning is
printed. Also, the following does not generate a warning in ghci:
{{{
import Prelude hiding (zip)
zip :: [a] -> [b] -> [(a,b)]
zip _ _ = undefined
}}}
I expect ghci and ghc to agree on the warnings unless there's a good
reason not to, and I do not expect warnings about declarations to depend
on their implementation.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4047>
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