[commit: ghc] master: Fix and document cloneWC (857ef25)

git at git.haskell.org git at git.haskell.org
Wed Jul 25 11:26:10 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/857ef25e3b077ac1cdf54e2e6f7adf9a1c83a31e/ghc

>---------------------------------------------------------------

commit 857ef25e3b077ac1cdf54e2e6f7adf9a1c83a31e
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Jul 25 11:47:45 2018 +0100

    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.


>---------------------------------------------------------------

857ef25e3b077ac1cdf54e2e6f7adf9a1c83a31e
 compiler/typecheck/TcErrors.hs     |  2 +-
 compiler/typecheck/TcEvidence.hs   | 20 +++++++++---------
 compiler/typecheck/TcHoleErrors.hs |  2 +-
 compiler/typecheck/TcHsSyn.hs      |  2 +-
 compiler/typecheck/TcInteract.hs   |  4 ++--
 compiler/typecheck/TcMType.hs      | 42 +++++++++++++++++++++++++-------------
 compiler/typecheck/TcRnMonad.hs    | 24 ++++++++++++++++------
 7 files changed, 61 insertions(+), 35 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 857ef25e3b077ac1cdf54e2e6f7adf9a1c83a31e


More information about the ghc-commits mailing list