[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 <ben@…>): In [changeset:"fad822e2a5aa4373c3aa64e913e51fd5509c3f67/ghc" fad822e/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="fad822e2a5aa4373c3aa64e913e51fd5509c3f67" Improve the warning message of qualified unused imports. Pretty-print unused imported names unqualified unconditionally to make the warning message consistent for ambiguous/unambiguous identifiers. Signed-off-by: HE, Tao <sighingnow@gmail.com> Test Plan: make test TEST="T14881" Reviewers: bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, thomie, carter GHC Trac Issues: #14881 Differential Revision: https://phabricator.haskell.org/D4461 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14881#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#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