GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-08-10T10:55:49Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/16856Qualified Prelude and -Wdodgy-exports2019-08-10T10:55:49ZfosskersQualified Prelude and -Wdodgy-exports# Summary
When reexporting symbols from `Prelude` from some module `A`, then further reexporting `A` from another module which also imports the `Prelude` qualified, `-Wdodgy-exports` can be triggered. This pattern of reexporting shows ...# Summary
When reexporting symbols from `Prelude` from some module `A`, then further reexporting `A` from another module which also imports the `Prelude` qualified, `-Wdodgy-exports` can be triggered. This pattern of reexporting shows up often in "alternate Preludes".
# Steps to reproduce
Produce a module `Fun`:
```haskell
module Fun
( Data.Bool.Bool(..) -- A symbol also present in Prelude
) where
import qualified Data.Bool
```
now produce a module `Lib`:
```haskell
module Lib
( module Fun -- reexports Bool
) where
import qualified Fun
-- import qualified Prelude
```
Compile with `-Wall`, and see no warnings. Now uncomment the qualified import of `Prelude` and see the following:
```
/home/colin/code/haskell/dodgy-bug/src/Lib.hs:2:5-14: warning: [-Wdodgy-exports]
The export item ‘module Fun’ exports nothing
|
2 | ( module Fun
| ^^^^^^^^^^
/home/colin/code/haskell/dodgy-bug/src/Lib.hs:5:1-20: warning: [-Wunused-imports]
The qualified import of ‘Fun’ is redundant
|
5 | import qualified Fun
| ^^^^^^^^^^^^^^^^^^^^
/home/colin/code/haskell/dodgy-bug/src/Lib.hs:6:1-24: warning: [-Wunused-imports]
The qualified import of ‘Prelude’ is redundant
|
6 | import qualified Prelude
| ^^^^^^^^^^^^^^^^^^^^^^^^
```
*Now* remove the `qualified` section of the `Prelude` import, and see no warnings. The presence/absence of `NoImplicitPrelude` seems to have no effect here.
# Expected behavior
I'd expect no warnings in any of the three cases.
# Environment
* GHC version used: 8.6.5
Optional:
* Operating System: Arch Linux
* System Architecture: x86_648.8.2