[GHC] #14059: COMPLETE sets don't work at all with data family instances
GHC
ghc-devs at haskell.org
Sun Jun 3 04:30:13 UTC 2018
#14059: COMPLETE sets don't work at all with data family instances
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.2.1
Resolution: | Keywords:
| PatternSynonyms,
| PatternMatchWarnings
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4752
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari <ben@…>):
In [changeset:"4d8004483387c087f5132736863d895ae4869163/ghc" 4d80044/ghc]:
{{{
#!CommitTicketReference repository="ghc"
revision="4d8004483387c087f5132736863d895ae4869163"
Fix a bad interaction between GADTs and COMPLETE sets
As observed in #14059 (starting at comment 5), the error
messages surrounding a program involving GADTs and a `COMPLETE` set
became worse between 8.2 and 8.4. The culprit was a new validity
check in 8.4 which filters out `COMPLETE` set candidates if a return
type of any conlike in the set doesn't match the type of the
scrutinee. However, this check was too conservative, since it removed
perfectly valid `COMPLETE` sets that contained GADT constructors,
which quite often have return types that don't match the type of a
scrutinee.
To fix this, I adopted the most straightforward possible solution of
only performing this validity check on //pattern synonym//
constructors, not //data// constructors.
Note that this does not fix #14059 entirely, but instead simply fixes
a particular buglet that was discovered in that ticket.
Test Plan: make test TEST=T14059
Reviewers: bgamari, mpickering
Reviewed By: mpickering
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #14059
Differential Revision: https://phabricator.haskell.org/D4752
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14059#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list