[GHC] #10668: Missing brackets in import hint with TypeOperators
#10668: Missing brackets in import hint with TypeOperators -------------------------------------+------------------------------------- Reporter: bjmprice | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 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: | -------------------------------------+------------------------------------- {{{#!hs import Data.Type.Equality(Refl) }}} errors with {{{ 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( :~:(..) ) }}} But the code there does not parse, one needs {{{#!hs import Data.Type.Equality((:~:)(Refl)) }}} instead (note the extra brackets!). -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10668> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#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: -------------------------------------+------------------------------------- Changes (by thomasw): * owner: => thomasw -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10668#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#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: -------------------------------------+------------------------------------- Comment (by thomasw): I have found the cause, I'll upload a diff on Phabricator. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10668#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#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 -------------------------------------+------------------------------------- Changes (by thomasw): * differential: => Phab:D1093 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10668#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#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
#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: T10668 Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1093 -------------------------------------+------------------------------------- Changes (by thomasw): * testcase: => T10668 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10668#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10668: Missing brackets in import hint with TypeOperators -------------------------------------+------------------------------------- Reporter: bjmprice | Owner: thomasw Type: bug | Status: merge Priority: normal | Milestone: 7.10.3 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: T10668 Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1093 -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => merge * milestone: => 7.10.3 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10668#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10668: Missing brackets in import hint with TypeOperators -------------------------------------+------------------------------------- Reporter: bjmprice | Owner: thomasw Type: bug | Status: closed Priority: normal | Milestone: 7.10.3 Component: Compiler | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: T10668 Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1093 -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-7.10` as 9cab391. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10668#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC