[GHC] #12429: Pattern synonym parse error should recommend enabling extension
#12429: Pattern synonym parse error should recommend enabling extension -------------------------------------+------------------------------------- Reporter: agibiansky | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.10.3 Keywords: pattern | Operating System: Unknown/Multiple synonym error messages | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Currently, if you try to use pattern synonyms in a module without -XPatternSynonyms, you can get a very uninformative parse error. For example: {{{#!hs module X where import Data.Text (pattern Y) x = 3 }}} Yields, when compiled on GHC 7.10, {{{ test.hs:3:27: parse error on input "Y" }}} It would be helpful if in addition to the error, the message suggested to the user to enable the PatternSynonyms extension, as many other error messages already do. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12429> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12429: Pattern synonym parse error should recommend enabling extension -------------------------------------+------------------------------------- Reporter: agibiansky | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * keywords: pattern synonym error messages => PatternSynonyms -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12429#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12429: Pattern synonym parse error should recommend enabling extension -------------------------------------+------------------------------------- Reporter: agibiansky | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): That sounds very sensible and do-able. Would anyone like to offer a patch? We have precedents; e.g. a sensible error when people use `forall` without `RankNTypes`. Simon -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12429#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12429: Pattern synonym parse error should recommend enabling extension -------------------------------------+------------------------------------- Reporter: agibiansky | Owner: (none) Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: | PatternSynonyms, newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * keywords: PatternSynonyms => PatternSynonyms, newcomer -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12429#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12429: Pattern synonym parse error should recommend enabling extension -------------------------------------+------------------------------------- Reporter: agibiansky | Owner: ruperthorlick Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: | PatternSynonyms, newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | parser/should_fail/T12429 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by ruperthorlick): * owner: (none) => ruperthorlick * testcase: => parser/should_fail/T12429 * version: 7.10.3 => 8.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12429#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12429: Pattern synonym parse error should recommend enabling extension -------------------------------------+------------------------------------- Reporter: agibiansky | Owner: ruperthorlick Type: bug | Status: patch Priority: low | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: | PatternSynonyms, newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | parser/should_fail/T12429 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3261 Wiki Page: | -------------------------------------+------------------------------------- Changes (by ruperthorlick): * status: new => patch * differential: => Phab:D3261 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12429#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12429: Pattern synonym parse error should recommend enabling extension -------------------------------------+------------------------------------- Reporter: agibiansky | Owner: ruperthorlick Type: bug | Status: patch Priority: low | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: | PatternSynonyms, newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | parser/should_fail/T12429 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3261 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"4b1f0721ce164d079848d1f8890630dbbf4cbf7a/ghc" 4b1f0721/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="4b1f0721ce164d079848d1f8890630dbbf4cbf7a" Add suggestion for PatternSynonyms parse error (fixes #12429) Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3261 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12429#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12429: Pattern synonym parse error should recommend enabling extension -------------------------------------+------------------------------------- Reporter: agibiansky | Owner: ruperthorlick Type: bug | Status: closed Priority: low | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: fixed | Keywords: | PatternSynonyms, newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | parser/should_fail/T12429 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3261 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.2.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12429#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC