[GHC] #12429: Pattern synonym parse error should recommend enabling extension

GHC ghc-devs at haskell.org
Sat Jul 23 20:28:09 UTC 2016


#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


More information about the ghc-tickets mailing list