[GHC] #14228: PatternSynonyms Non-exhaustive with UnboxedSums

GHC ghc-devs at haskell.org
Fri Sep 15 19:37:22 UTC 2017


#14228: PatternSynonyms Non-exhaustive with UnboxedSums
-------------------------------------+-------------------------------------
        Reporter:  guibou            |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:  8.2.2
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:  UnboxedSums,
                                     |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D3951
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"f4d50a0ec0d23dbcd61a014c8a773030c8fe310d/ghc"
 f4d50a0e/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="f4d50a0ec0d23dbcd61a014c8a773030c8fe310d"
 Fix #14228 by marking SumPats as non-irrefutable

 `isIrrefutableHsPat` should always return `False` for unboxed sum
 patterns (`SumPat`s), since they always have at least one other
 corresponding pattern of the same arity (since the minimum arity for a
 `SumPat` is 2). Failure to do so causes incorrect code to be generated
 for pattern synonyms that use unboxed sums, as shown in #14228.

 Test Plan: make test TEST=T14228

 Reviewers: austin, bgamari, simonpj

 Reviewed By: simonpj

 Subscribers: simonpj, rwbarton, thomie

 GHC Trac Issues: #14228

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

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


More information about the ghc-tickets mailing list