[GHC] #14098: Incorrect pattern match warning on nested GADTs

GHC ghc-devs at haskell.org
Fri Mar 2 21:53:55 UTC 2018


#14098: Incorrect pattern match warning on nested GADTs
-------------------------------------+-------------------------------------
        Reporter:  jmgrosen          |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:
                                     |  PatternMatchWarnings
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  error/warning at compile-time      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #11984            |  Differential Rev(s):  Phab:D4434
       Wiki Page:                    |
-------------------------------------+-------------------------------------

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

 In [changeset:"a2d03c69b782212e6c476cfc1870bae493a4ac89/ghc" a2d03c6/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="a2d03c69b782212e6c476cfc1870bae493a4ac89"
 Fix the coverage checker's treatment of existential tyvars

 Previously, the pattern-match coverage checker was far too
 eager to freshen the names of existentially quantified type
 variables, which led to incorrect sets of type constraints that
 misled GHC into thinking that certain programs that involve nested
 GADT pattern matches were non-exhaustive (when in fact they were).
 Now, we generate extra equality constraints in the ConCon case of
 the coverage algorithm to ensure that these fresh tyvars align
 with existing existential tyvars. See
 `Note [Coverage checking and existential tyvars]` for the full story.

 Test Plan: make test TEST="T11984 T14098"

 Reviewers: gkaracha, bgamari, simonpj

 Reviewed By: simonpj

 Subscribers: simonpj, rwbarton, thomie, carter

 GHC Trac Issues: #11984, #14098

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

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


More information about the ghc-tickets mailing list