[GHC] #14881: Consistent labeling of redundant, qualified imports

#14881: Consistent labeling of redundant, qualified imports -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: lowest | Milestone: Component: Compiler | Version: 8.2.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Poor/confusing Unknown/Multiple | error message Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- {{{ 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. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14881 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14881: Consistent labeling of redundant, qualified imports -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: lowest | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Currently this is by design. * `adjust` (unqualified) is unambiguous in this scope * But `lookup` is ambiguous -- it is not clear whether you mean `M.lookup` or `Prelude.lookup`. But I suppose that in the context of this error message we can ''only'' mean the `lookup` imported from `Data.Map` so we could unconditinally print unqualified. Any volunteers? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14881#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14881: Consistent labeling of redundant, qualified imports -------------------------------------+------------------------------------- Reporter: crockeea | Owner: sighingnow Type: bug | Status: new Priority: lowest | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by sighingnow): * owner: (none) => sighingnow -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14881#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14881: Consistent labeling of redundant, qualified imports -------------------------------------+------------------------------------- Reporter: crockeea | Owner: sighingnow Type: bug | Status: patch Priority: lowest | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4461 Wiki Page: | -------------------------------------+------------------------------------- Changes (by sighingnow): * status: new => patch * differential: => Phab:D4461 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14881#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14881: Consistent labeling of redundant, qualified imports
-------------------------------------+-------------------------------------
Reporter: crockeea | Owner: sighingnow
Type: bug | Status: patch
Priority: lowest | Milestone:
Component: Compiler | Version: 8.2.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Poor/confusing | Unknown/Multiple
error message | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4461
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#14881: Consistent labeling of redundant, qualified imports -------------------------------------+------------------------------------- Reporter: crockeea | Owner: sighingnow Type: bug | Status: closed Priority: lowest | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4461 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.6.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14881#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC