[GHC] #15918: GHC panic from QuantifiedConstraints(?)

GHC ghc-devs at haskell.org
Wed Feb 6 22:43:11 UTC 2019


#15918: GHC panic from QuantifiedConstraints(?)
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.6.2
      Resolution:                    |             Keywords:
                                     |  QuantifiedConstraints
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 > See the comments around that use of isReflexiveCo.

 Which comments?  I think you may be referring to `Note [Respecting
 definitional equality]` in `TyCoRep`. Anything else?

 Let me also note that
 * In GHC today we use `mkNakedCastTy` which absolutely does not remove the
 casts that the above `Note` says it should.
 * The typechecker is careful to push casts out of the way when solving
 equalities, which helps.  But it still has lots of `tcSplitX` calls.

 > I think that's problematic.

 What do you suggest we do?  As comment:3 shows, if we have `mkTcCastTy`
 we'll need `mkTcAppTy`.  And `tcSubstTy` and `tcSubstTheta`. And
 `tcInstDFunType`.  It's pretty hard to be sure that we've nailed all the
 places.  Duplicating all this stuff doesn't smell right to me.

 Hmm. Currently `mkCastTy` will remove a cast between `Type` and
 `Coercion`, because the two are equal in Core.  But such a cast would
 yield a typechecker error (which is what both #15799 and this ticket
 involve), so we'd never get as far as Core.  How bad would it be if
 `mkCastTy` did not remove a cast between `Type` and `Coercion`?

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


More information about the ghc-tickets mailing list