[GHC] #11325: Type of hole does not get refined after pattern matching on [GADT] constructors

GHC ghc-devs at haskell.org
Fri May 19 10:11:53 UTC 2017


#11325: Type of hole does not get refined after pattern matching on [GADT]
constructors
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  goldfire
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  7.11
  checker)                           |
      Resolution:                    |             Keywords:  GADTs
Operating System:  Linux             |         Architecture:  x86
 Type of failure:  Incorrect         |            Test Case:
  warning at compile-time            |
      Blocked By:                    |             Blocking:
 Related Tickets:  #12468            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Simon Peyton Jones <simonpj@…>):

 In [changeset:"433b80dec1cfef787fc1327a9eada1791b11c12e/ghc" 433b80d/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="433b80dec1cfef787fc1327a9eada1791b11c12e"
 Ensure that insolubles are fully rewritten

 I was alerted to this by Trac #12468 and #11325.  We were treating
 insolubles (and "hole" constraints are treated as insoluble)
 inconsistently.  In some places we were carefully rewriting them
 e.g. Note [Make sure that insolubles are fully rewritten] in
 TcCanonical.  But in TcSimplify we weren't feeding them into
 the solver.

 As a result, "hole" constraints were not being rewritten, which
 some users found confusing, and I think rightly so.

 This patch also fixes a bug in TcSMonad.emitInsoluble, in which two
 different "hole" constriants could be treated (bogusly) as duplicates,
 thereby losing one.
 }}}

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


More information about the ghc-tickets mailing list