[commit: ghc] master: Improve error messages for skolems (48d1866)

git at git.haskell.org git at git.haskell.org
Fri Mar 10 16:06:03 UTC 2017


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

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

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

commit 48d1866e9051e52b80c9c88547bd66d66483f1d5
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Mar 10 11:46:50 2017 +0000

    Improve error messages for skolems
    
    In error messages like this
        • Couldn't match type ‘c’ with ‘f0 (a -> b)’
          ‘c’ is a rigid type variable bound by
            the type signature for:
              f :: ((a -> b) -> b) -> forall c. c -> a
    
    we need to take case both to actually show that 'forall c',
    and to make sure that its name lines with the 'c' in the
    error message.
    
    This has been shaky for some time, and this commit puts it on solid
    ground.  See TcRnTypes: Note [SigSkol SkolemInfo]
    
    The main changes are
    
    * SigSkol gets an extra field that records the way in which the
      type signature was skolemised.
    
    * The type in SigSkol is now the /un/-skolemised version
    
    * pprSkolemInfo uses the info to make the tidy type line up
      nicely
    
    Lots of error message wibbles!


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

48d1866e9051e52b80c9c88547bd66d66483f1d5
 compiler/typecheck/Inst.hs                         | 52 ++++++++++---------
 compiler/typecheck/TcBinds.hs                      |  4 +-
 compiler/typecheck/TcErrors.hs                     | 19 +++----
 compiler/typecheck/TcExpr.hs                       |  4 +-
 compiler/typecheck/TcMType.hs                      | 58 ++++++++++++++++------
 compiler/typecheck/TcRnDriver.hs                   |  2 +-
 compiler/typecheck/TcRnTypes.hs                    | 45 ++++++++++++++---
 compiler/typecheck/TcSimplify.hs                   |  2 +-
 compiler/typecheck/TcUnify.hs                      | 17 +++----
 compiler/types/TyCoRep.hs                          |  3 +-
 testsuite/tests/ado/ado005.stderr                  | 42 +++++++++-------
 .../tests/backpack/should_fail/bkpfail24.stderr    |  2 +-
 .../tests/backpack/should_fail/bkpfail44.stderr    |  2 +-
 testsuite/tests/deriving/should_fail/T5287.stderr  |  2 +-
 .../should_compile/PushedInAsGivens.stderr         |  2 +-
 .../indexed-types/should_compile/T3208b.stderr     |  4 +-
 .../tests/indexed-types/should_fail/T2664.stderr   |  3 +-
 .../tests/indexed-types/should_fail/T4093a.stderr  |  2 +-
 .../tests/indexed-types/should_fail/T4093b.stderr  |  3 +-
 .../tests/indexed-types/should_fail/T7194.stderr   |  2 +-
 testsuite/tests/monadfail/MonadFailErrors.stderr   |  4 +-
 testsuite/tests/monadfail/MonadFailWarnings.stderr |  4 +-
 .../should_fail/overloadedlabelsfail01.stderr      |  2 +-
 testsuite/tests/parser/should_fail/T7848.stderr    |  2 +-
 .../partial-sigs/should_compile/T10403.stderr      |  2 +-
 testsuite/tests/polykinds/T7230.stderr             |  4 +-
 testsuite/tests/polykinds/T7594.stderr             |  2 +-
 .../tests/typecheck/should_compile/T7220a.stderr   |  7 ++-
 .../tests/typecheck/should_compile/T9834.stderr    |  4 +-
 .../tests/typecheck/should_compile/T9939.stderr    |  8 +--
 .../tests/typecheck/should_compile/tc168.stderr    |  8 +--
 .../typecheck/should_fail/ClassOperator.stderr     |  8 +--
 .../tests/typecheck/should_fail/T10534.stderr      |  2 +-
 .../tests/typecheck/should_fail/T11947a.stderr     |  2 +-
 .../tests/typecheck/should_fail/T11948.stderr      |  2 +-
 .../tests/typecheck/should_fail/T12151.stderr      |  2 +-
 .../tests/typecheck/should_fail/T12918b.stderr     |  2 +-
 .../tests/typecheck/should_fail/T1897a.stderr      |  2 +-
 testsuite/tests/typecheck/should_fail/T2714.stderr |  8 +--
 testsuite/tests/typecheck/should_fail/T3592.stderr |  4 +-
 testsuite/tests/typecheck/should_fail/T5300.stderr |  7 ++-
 testsuite/tests/typecheck/should_fail/T7279.stderr |  2 +-
 testsuite/tests/typecheck/should_fail/T7437.stderr |  4 +-
 testsuite/tests/typecheck/should_fail/T7453.stderr |  6 +--
 testsuite/tests/typecheck/should_fail/T7869.stderr |  2 +-
 .../tests/typecheck/should_fail/tcfail032.stderr   |  2 +-
 .../tests/typecheck/should_fail/tcfail034.stderr   |  4 +-
 .../tests/typecheck/should_fail/tcfail067.stderr   | 14 +++---
 .../tests/typecheck/should_fail/tcfail072.stderr   |  2 +-
 .../tests/typecheck/should_fail/tcfail080.stderr   |  2 +-
 .../tests/typecheck/should_fail/tcfail097.stderr   |  5 +-
 .../tests/typecheck/should_fail/tcfail098.stderr   |  2 +-
 .../tests/typecheck/should_fail/tcfail102.stderr   |  2 +-
 .../tests/typecheck/should_fail/tcfail116.stderr   |  2 +-
 .../tests/typecheck/should_fail/tcfail125.stderr   |  2 +-
 .../tests/typecheck/should_fail/tcfail142.stderr   |  5 +-
 .../tests/typecheck/should_fail/tcfail171.stderr   |  2 +-
 .../tests/typecheck/should_fail/tcfail198.stderr   |  2 +-
 .../tests/typecheck/should_fail/tcfail208.stderr   |  2 +-
 .../tests/warnings/should_compile/PluralS.stderr   |  6 ++-
 .../wcompat-warnings/WCompatWarningsOn.stderr      |  4 +-
 61 files changed, 250 insertions(+), 178 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 48d1866e9051e52b80c9c88547bd66d66483f1d5


More information about the ghc-commits mailing list