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
Showing
- compiler/hsSyn/HsPat.hs 25 additions, 2 deletionscompiler/hsSyn/HsPat.hs
- testsuite/tests/patsyn/should_run/T14228.hs 22 additions, 0 deletionstestsuite/tests/patsyn/should_run/T14228.hs
- testsuite/tests/patsyn/should_run/T14228.stdout 4 additions, 0 deletionstestsuite/tests/patsyn/should_run/T14228.stdout
- testsuite/tests/patsyn/should_run/all.T 1 addition, 0 deletionstestsuite/tests/patsyn/should_run/all.T
Loading
Please register or sign in to comment