Skip to content

Consistent labeling of redundant, qualified imports

import Data.Map as M (Map, adjust, lookup, fromList)
foo :: Map Int Int
foo = fromList []

GHC helpfully suggests:

Bug.hs:3:1: warning: [-Wunused-imports]
    The import of `adjust, M.lookup'
    from module `Data.Map' is redundant
  |
3 | import Data.Map as M (Map, adjust, lookup, fromList)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

However, this message can be improved. Notice that in the line "The import of ...", adjust is *not* qualified, while lookup *is* qualified. It would be better if this was consistent.

Trac metadata
Trac field Value
Version 8.2.2
Type Bug
TypeOfFailure OtherFailure
Priority lowest
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information