[GHC] #14880: GHC panic: updateRole

GHC ghc-devs at haskell.org
Wed Sep 12 15:34:47 UTC 2018


#14880: GHC panic: updateRole
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  goldfire
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Compiler (Type    |              Version:  8.2.2
  checker)                           |
      Resolution:                    |             Keywords:  TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #15076            |  Differential Rev(s):  Phab:D4769,
       Wiki Page:                    |  Phab:D5141
-------------------------------------+-------------------------------------

Comment (by simonpj):

 > If a variable is not in the bound-var set (in other words, if we look at
 it at all), then no variable in its kind is in the bound-var set (so we
 can zap the bound-var set).

 No, not at all!  Suppose (b::k) is free in some type `(forall k. b -> T
 k)`.  Then, when we encounter `b`

 * `b` is not in the bound-var set
 * But `k` certainly is, and should be
 * But it's a ''different k'', despite having the same name

 So it's not just that we ''can'' zap the bound-var set; we ''must'' zap
 it!!

 Consider: if we instead waited until the end we'd have `b::k` in our free
 var set. Then we call `closeOverKinds` (that was our plan, before
 comment:123).  Well, at that point the bound-var set is certainly empty
 (we are at the top), and we find the free vars of `k` (namely `k` itself)
 using that empty bound-var set.

 Regardless, this still looks solid to me, if Tobias can just test it.

 (It could conceivably be worth doing `TcType.candidateQTyVarsOfType` the
 same way, for consistency; but that is an un-forced change.)

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


More information about the ghc-tickets mailing list