[GHC] #14763: GHC 8.4.1-alpha regression with FunctionalDependencies

GHC ghc-devs at haskell.org
Thu Feb 8 14:58:46 UTC 2018


#14763: GHC 8.4.1-alpha regression with FunctionalDependencies
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:  8.4.1
       Component:  Compiler (Type    |              Version:  8.4.1-alpha3
  checker)                           |
      Resolution:                    |             Keywords:  FunDeps
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

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

 In [changeset:"6edafe3be0133fe69581fb3851a812c69ab9dbf7/ghc" 6edafe3/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="6edafe3be0133fe69581fb3851a812c69ab9dbf7"
 Fix isDroppableCt (Trac #14763)

 When finishing up an implication constraint, it's a bit tricky to
 decide which Derived constraints to retain (for error reporting) and
 which to discard.  I got this wrong in commit
    f20cf982f126aea968ed6a482551550ffb6650cf
    (Remove wc_insol from WantedConstraints)

 The particular problem in Trac #14763 was that we were reporting as an
 error a fundep-generated constraint
   (ex ~ T)
 where 'ex' is an existentially-bound variable in a pattern match.
 But this isn't really an error at all.

 This patch fixes the problem. Indeed, since I had to understand
 this rather tricky code, I took the opportunity to clean it up
 and document better.  See
   isDroppableCt :: Ct -> Bool
 and Note [Dropping derived constraints]

 I also removed wl_deriv altogether from the WorkList data type.  It
 was there in the hope of gaining efficiency by not even processing
 lots of derived constraints, but it has turned out that most derived
 constraints (notably equalities) must be processed anyway; see
 Note [Prioritise equalities] in TcSMonad.

 The two are coupled because to decide which constraints to put in
 wl_deriv I was using another variant of isDroppableCt.  Now it's much
 simpler -- and perhaps even more efficient too.
 }}}

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


More information about the ghc-tickets mailing list