[GHC] #15290: QuantifiedConstraints: panic "addTcEvBind NoEvBindsVar"

GHC ghc-devs at haskell.org
Thu Jul 5 13:51:59 UTC 2018


#15290: QuantifiedConstraints: panic "addTcEvBind NoEvBindsVar"
-------------------------------------+-------------------------------------
        Reporter:  goldfire          |                Owner:  (none)
            Type:  bug               |               Status:  merge
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.4.3
      Resolution:                    |             Keywords:
                                     |  QuantifiedConstraints
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:  quantified-
                                     |  constraints/T15290, T15290a
      Blocked By:                    |             Blocking:  9123
 Related Tickets:                    |  Differential Rev(s):  Phab:D4895
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ryan Scott <ryan.gl.scott@…>):

 In [changeset:"132273f34e394bf7e900d0c15e01e91edd711890/ghc"
 132273f3/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="132273f34e394bf7e900d0c15e01e91edd711890"
 Instantiate GND bindings with an explicit type signature

 Summary:
 Before, we were using visible type application to apply
 impredicative types to `coerce` in
 `GeneralizedNewtypeDeriving`-generated bindings. This approach breaks
 down when combined with `QuantifiedConstraints` in certain ways,
 which #14883 and #15290 provide examples of. See
 Note [GND and QuantifiedConstraints] for all the gory details.

 To avoid this issue, we instead use an explicit type signature to
 instantiate each GND binding, and use that to bind any type variables
 that might be bound by a class method's type signature. This reduces
 the need to impredicative type applications, and more importantly,
 makes the programs from #14883 and #15290 work again.

 Test Plan: make test TEST="T15290b T15290c T15290d T14883"

 Reviewers: simonpj, bgamari

 Reviewed By: simonpj

 Subscribers: rwbarton, thomie, carter

 GHC Trac Issues: #14883, #15290

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

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


More information about the ghc-tickets mailing list