[GHC] #14114: Strange behavior when pattern variables are duplicated on pattern synonym RHS

GHC ghc-devs at haskell.org
Tue Aug 22 14:56:18 UTC 2017


#14114: Strange behavior when pattern variables are duplicated on pattern synonym
RHS
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      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):  Phab:D3866
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ryan Scott <ryan.gl.scott@…>):

 In [changeset:"a89bb806c58d3e601b37d6f2c4ebec6514fd2776/ghc" a89bb80/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="a89bb806c58d3e601b37d6f2c4ebec6514fd2776"
 Fix #14114 by checking for duplicate vars on pattern synonym RHSes

 Summary:
 Because we weren't checking for duplicate variables on the right-hand
 sides of pattern synonyms, bogus definitions like this one passed the
 renamer:

 ```lang=haskell
 pattern Foo a <- (a,a)
 ```

 Luckily, the fix is simple.

 Test Plan: make test TEST=T14114

 Reviewers: mpickering, austin, bgamari, simonpj

 Reviewed By: simonpj

 Subscribers: simonpj, rwbarton, thomie

 GHC Trac Issues: #14114

 Differential Revision: https://phabricator.haskell.org/D3866
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14114#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list