#10668: Missing brackets in import hint with TypeOperators -------------------------------------+------------------------------------- Reporter: bjmprice | Owner: thomasw Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1093 -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"b5c94262fa79f735334165c53667f113e07df5e1/ghc" b5c94262/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="b5c94262fa79f735334165c53667f113e07df5e1" Parenthesise TypeOperator in import hints When a constructor was mistakenly imported directly instead of as a constructor of a data type, a hint will be shown on how to correctly import it. Just like the constructor, the data type should be surrounded in parentheses if it is an operator (TypeOperator in this case). Instead of: error: In module ‘Data.Type.Equality’: ‘Refl’ is a data constructor of ‘:~:’ To import it use ‘import’ Data.Type.Equality( :~:( Refl ) ) or ‘import’ Data.Type.Equality( :~:(..) ) Print: error: In module ‘Data.Type.Equality’: ‘Refl’ is a data constructor of ‘(:~:)’ To import it use ‘import’ Data.Type.Equality( (:~:)( Refl ) ) or ‘import’ Data.Type.Equality( (:~:)(..) ) Test Plan: pass new test Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1093 GHC Trac Issues: #10668 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10668#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler