[commit: ghc] master: Track visibility in TypeEqOrigin (fb75213)

git at git.haskell.org git at git.haskell.org
Thu Jul 27 11:49:58 UTC 2017


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

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

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

commit fb752133f45f01b27240d7cc6bce2063a015e51b
Author: Richard Eisenberg <rae at cs.brynmawr.edu>
Date:   Tue Jul 18 14:30:40 2017 -0400

    Track visibility in TypeEqOrigin
    
    A type equality error can arise from a mismatch between
    *invisible* arguments just as easily as from visible arguments.
    But we should really prefer printing out errors from visible
    arguments over invisible ones. Suppose we have a mismatch between
    `Proxy Int` and `Proxy Maybe`. Would you rather get an error
    between `Int` and `Maybe`? Or between `*` and `* -> *`? I thought
    so, too.
    
    There is a fair amount of plumbing with this one, but I think
    it's worth it.
    
    This commit introduces a performance regression in test
    perf/compiler/T5631. The cause of the regression is not the
    new visibility stuff, directly: it's due to a change from
    zipWithM to zipWith3M in TcUnify. To my surprise, zipWithM
    is nicely optimized (it fuses away), but zipWith3M is not.
    There are other examples of functions that could be made faster,
    so I've posted a separate ticket, #14037, to track these
    improvements. For now, I've accepted the small (6.6%) regression.


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

fb752133f45f01b27240d7cc6bce2063a015e51b
 compiler/typecheck/Inst.hs                         |  3 +-
 compiler/typecheck/TcCanonical.hs                  | 18 +++--
 compiler/typecheck/TcErrors.hs                     | 29 ++++----
 compiler/typecheck/TcHsType.hs                     |  5 +-
 compiler/typecheck/TcRnTypes.hs                    | 30 ++++++++-
 compiler/typecheck/TcType.hs                       | 38 ++++++++++-
 compiler/typecheck/TcUnify.hs                      | 78 +++++++++++++---------
 testsuite/tests/perf/compiler/all.T                |  4 +-
 testsuite/tests/polykinds/KindVType.stderr         |  2 +-
 .../tests/typecheck/should_fail/T12373.stderr      |  3 +
 .../tests/typecheck/should_fail/T13530.stderr      |  3 +
 testsuite/tests/typecheck/should_fail/T8603.stderr |  7 +-
 12 files changed, 153 insertions(+), 67 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 fb752133f45f01b27240d7cc6bce2063a015e51b


More information about the ghc-commits mailing list