Skip to content

Improve "openness" check for re-exports #2726

Description

@garyb

Writing this does not currently raise a warning:

module ReExport
  ( module A
  , module B
  ) where

import Data.Functor as A
import Data.Semigroup as B

But it should, as it suffers from the same issue as this:

module ReExport
  ( module Data.Functor
  , module Data.Semigroup
  ) where

import Data.Functor
import Data.Semigroup

Which does warn, asking for explicit imports from both modules, as they're being opened into the same namespace. In the first example this is also true as A and B are merged into one namespace in the exports of the module.

No doubt this will annoy people, unfortunately, as I'm pretty sure it's used to work around the export rules as they stand in some libraries - but we should at least apply the rules consistently or give up on safe import behaviour entirely.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions