[commit: ghc] master: Fix #15039 by pretty-printing equalities more systematically (99f8cc8)

git at git.haskell.org git at git.haskell.org
Wed May 16 19:41:04 UTC 2018


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

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

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

commit 99f8cc84a5b23878b3b0732955cb651bc973e9f2
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Wed May 16 12:11:37 2018 -0400

    Fix #15039 by pretty-printing equalities more systematically
    
    GHC previously had a handful of special cases for
    pretty-printing equalities in a more user-friendly manner, but they
    were far from comprehensive (see #15039 for an example of where this
    fell apart).
    
    This patch makes the pretty-printing of equalities much more
    systematic. I've adopted the approach laid out in
    https://ghc.haskell.org/trac/ghc/ticket/15039#comment:4, and updated
    `Note [Equality predicates in IfaceType]` accordingly. We are now
    more careful to respect the properties of the
    `-fprint-explicit-kinds` and `-fprint-equality-relations` flags,
    which led to some improvements in error message outputs.
    
    Along the way, I also tweaked the error-reporting machinery not to
    print out the type of a typed hole when the type is an unlifted
    equality, since it's kind (`TYPE ('TupleRep '[])`) was more
    confusing than anything.
    
    Test Plan: make test TEST="T15039a T15039b T15039c T15039d"
    
    Reviewers: simonpj, goldfire, bgamari
    
    Reviewed By: simonpj
    
    Subscribers: rwbarton, thomie, carter
    
    GHC Trac Issues: #15039
    
    Differential Revision: https://phabricator.haskell.org/D4696


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

99f8cc84a5b23878b3b0732955cb651bc973e9f2
 compiler/iface/IfaceType.hs                        | 127 +++++++++++++++------
 compiler/prelude/TysWiredIn.hs-boot                |   2 +
 compiler/typecheck/TcErrors.hs                     |   8 +-
 .../tests/deSugar/should_compile/T2431.stderr      |   6 +-
 .../tests/partial-sigs/should_compile/T15039a.hs   |  41 +++++++
 .../partial-sigs/should_compile/T15039a.stderr     |  55 +++++++++
 .../tests/partial-sigs/should_compile/T15039b.hs   |  41 +++++++
 .../partial-sigs/should_compile/T15039b.stderr     |  56 +++++++++
 .../tests/partial-sigs/should_compile/T15039c.hs   |  41 +++++++
 .../partial-sigs/should_compile/T15039c.stderr     |  55 +++++++++
 .../tests/partial-sigs/should_compile/T15039d.hs   |  41 +++++++
 .../partial-sigs/should_compile/T15039d.stderr     |  58 ++++++++++
 testsuite/tests/partial-sigs/should_compile/all.T  |   6 +-
 .../tests/patsyn/should_compile/T14394.stdout      |   2 +-
 .../tests/roles/should_compile/Roles13.stderr      |   2 +-
 .../tests/typecheck/should_compile/T13032.stderr   |   2 +-
 .../tests/typecheck/should_fail/T14390.stderr      |   2 +-
 17 files changed, 496 insertions(+), 49 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 99f8cc84a5b23878b3b0732955cb651bc973e9f2


More information about the ghc-commits mailing list