[commit: ghc] wip/hie-module: Fail fast in solveLocalEqualities (5c1f268)

git at git.haskell.org git at git.haskell.org
Fri Feb 15 10:15:54 UTC 2019


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

On branch  : wip/hie-module
Link       : http://ghc.haskell.org/trac/ghc/changeset/5c1f268e2744fab2d36e64c163858995451d7095/ghc

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

commit 5c1f268e2744fab2d36e64c163858995451d7095
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Feb 14 08:28:43 2019 +0000

    Fail fast in solveLocalEqualities
    
    This patch makes us fail fast in TcSimplify.solveLocalEqualities,
    and in TcHsType.tc_hs_sig_type, if there are insoluble constraints.
    
    Previously we ploughed on even if there were insoluble constraints,
    leading to a cascade of hard-to-understand type errors. Failing
    eagerly is much better; hence a lot of testsuite error message
    changes.  Eg if we have
              f :: [Maybe] -> blah
              f xs = e
    then trying typecheck 'f x = e' with an utterly bogus type
    is just asking for trouble.
    
    I can't quite remember what provoked me to make this change,
    but I think the error messages are notably improved, by
    removing confusing clutter and focusing on the real error.


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

5c1f268e2744fab2d36e64c163858995451d7095
 compiler/typecheck/TcHsType.hs                     |   4 +
 compiler/typecheck/TcSimplify.hs                   |  19 +++-
 .../tests/dependent/should_fail/DepFail1.stderr    |  16 ---
 testsuite/tests/ghci/scripts/T15898.stderr         |  28 ------
 .../tests/indexed-types/should_fail/T13877.stderr  |  22 +----
 .../tests/partial-sigs/should_fail/T11976.stderr   |  11 ---
 .../tests/partial-sigs/should_fail/T12634.stderr   |  23 +----
 testsuite/tests/patsyn/should_fail/T15289.stderr   |   6 --
 testsuite/tests/polykinds/T12593.stderr            | 107 +--------------------
 testsuite/tests/polykinds/T15577.stderr            |  62 ------------
 .../tests/typecheck/should_fail/T11112.stderr      |   9 --
 .../tests/typecheck/should_fail/T13819.stderr      |  11 ---
 .../tests/typecheck/should_fail/T14232.stderr      |  13 ---
 testsuite/tests/typecheck/should_fail/T3540.stderr |  10 --
 testsuite/tests/typecheck/should_fail/T7778.stderr |   6 --
 testsuite/tests/typecheck/should_fail/T8806.stderr |   6 +-
 .../tests/typecheck/should_fail/VtaFail.stderr     |  22 -----
 .../tests/typecheck/should_fail/tcfail057.stderr   |   9 --
 .../tests/typecheck/should_fail/tcfail058.stderr   |  20 ----
 .../tests/typecheck/should_fail/tcfail063.stderr   |  17 ----
 .../tests/typecheck/should_fail/tcfail113.stderr   |  21 ----
 .../tests/typecheck/should_fail/tcfail160.stderr   |   6 --
 .../tests/typecheck/should_fail/tcfail161.stderr   |   8 --
 .../tests/typecheck/should_fail/tcfail212.stderr   |  36 ++++---
 24 files changed, 50 insertions(+), 442 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 5c1f268e2744fab2d36e64c163858995451d7095


More information about the ghc-commits mailing list