Fix and document cloneWC
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 25 Jul 2018 10:47:45 +0000 (11:47 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 25 Jul 2018 11:04:31 +0000 (12:04 +0100)
commit857ef25e3b077ac1cdf54e2e6f7adf9a1c83a31e
tree42f2187c61b0b90df8ade7b0d51a73fcf4d48e1c
parentc5d31df70b16dc346b5860077c8bbe585ddb7a78
Fix and document cloneWC

The cloneWC, cloneWanted, cloneImplication family are used by
  * TcHoleErrors
  * TcRule
to clone the /bindings/ in a constraint, so that solving the
constraint will not add bindings to the program. The idea is only
to affect unifications.

But I had it wrong -- I failed to clone the EvBindsVar of an
implication.  That gave an assert failure, I think, as well as
useless dead code.

The fix is easy.  I'm not adding a test case.

In the type 'TcEvidence.EvBindsVar', I also renamed the
'NoEvBindsVar' constructor to 'CoEvBindsVar'.  It's not that we
have /no/ evidence bindings, just that we can only have coercion
bindings, done via HoleDest.
compiler/typecheck/TcErrors.hs
compiler/typecheck/TcEvidence.hs
compiler/typecheck/TcHoleErrors.hs
compiler/typecheck/TcHsSyn.hs
compiler/typecheck/TcInteract.hs
compiler/typecheck/TcMType.hs
compiler/typecheck/TcRnMonad.hs