[commit: ghc] master: Finish fix for #14880. (5e45ad1)

git at git.haskell.org git at git.haskell.org
Mon Oct 29 03:18:07 UTC 2018


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

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

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

commit 5e45ad10ffca1ad175b10f6ef3327e1ed8ba25f3
Author: Tobias Dammers <tdammers at gmail.com>
Date:   Thu Sep 13 09:56:02 2018 +0200

    Finish fix for #14880.
    
    The real change that fixes the ticket is described in
    Note [Naughty quantification candidates] in TcMType.
    
    Fixing this required reworking candidateQTyVarsOfType, the function
    that extracts free variables as candidates for quantification.
    One consequence is that we now must be more careful when quantifying:
    any skolems around must be quantified manually, and quantifyTyVars
    will now only quantify over metavariables. This makes good sense,
    as skolems are generally user-written and are listed in the AST.
    
    As a bonus, we now have more control over the ordering of such
    skolems.
    
    Along the way, this commit fixes #15711 and refines the fix
    to #14552 (by accepted a program that was previously rejected,
    as we can now accept that program by zapping variables to Any).
    
    This commit also does a fair amount of rejiggering kind inference
    of datatypes. Notably, we now can skip the generalization step
    in kcTyClGroup for types with CUSKs, because we get the
    kind right the first time. This commit also thus fixes #15743 and
     #15592, which both concern datatype kind generalisation.
    (#15591 is also very relevant.) For this aspect of the commit, see
    Note [Required, Specified, and Inferred in types] in TcTyClsDecls.
    
    Test cases: dependent/should_fail/T14880{,-2},
                dependent/should_fail/T15743[cd]
                dependent/should_compile/T15743{,e}
                ghci/scripts/T15743b
                polykinds/T15592
                dependent/should_fail/T15591[bc]
                ghci/scripts/T15591


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

5e45ad10ffca1ad175b10f6ef3327e1ed8ba25f3
 compiler/basicTypes/Var.hs                         |  59 +--
 compiler/basicTypes/VarSet.hs                      |   1 +
 compiler/coreSyn/MkCore.hs                         |   2 +-
 compiler/deSugar/DsBinds.hs                        |   2 +-
 compiler/main/HscTypes.hs                          |   4 +-
 compiler/prelude/TysWiredIn.hs-boot                |   2 +
 compiler/rename/RnTypes.hs                         |  21 +-
 compiler/simplCore/SetLevels.hs                    |   3 +-
 compiler/simplCore/SimplUtils.hs                   |   4 +-
 compiler/specialise/SpecConstr.hs                  |   2 +-
 compiler/typecheck/FamInst.hs                      |  10 +-
 compiler/typecheck/TcClassDcl.hs                   |   4 +-
 compiler/typecheck/TcDeriv.hs                      |   2 +-
 compiler/typecheck/TcErrors.hs                     |   2 +-
 compiler/typecheck/TcGenDeriv.hs                   |   4 +-
 compiler/typecheck/TcGenGenerics.hs                |   4 +-
 compiler/typecheck/TcHsSyn.hs                      |   2 +-
 compiler/typecheck/TcHsType.hs                     | 235 +++++----
 compiler/typecheck/TcInstDcls.hs                   |   2 +-
 compiler/typecheck/TcMType.hs                      | 411 +++++++++++++--
 compiler/typecheck/TcPatSyn.hs                     |  52 --
 compiler/typecheck/TcRules.hs                      |  26 +-
 compiler/typecheck/TcSMonad.hs                     |  15 +-
 compiler/typecheck/TcSigs.hs                       |   6 +-
 compiler/typecheck/TcSimplify.hs                   |  21 +-
 compiler/typecheck/TcTyClsDecls.hs                 | 573 +++++++++++----------
 compiler/typecheck/TcType.hs                       | 149 +-----
 compiler/typecheck/TcValidity.hs                   |  48 +-
 compiler/types/TyCoRep.hs                          |  35 +-
 compiler/types/TyCon.hs                            |  68 ++-
 compiler/types/Type.hs                             | 143 ++++-
 compiler/types/Type.hs-boot                        |   2 +-
 compiler/types/Unify.hs                            |   2 +-
 compiler/utils/UniqDFM.hs                          |   2 +
 compiler/utils/UniqDSet.hs                         |   1 +
 compiler/utils/Util.hs                             |   6 +-
 docs/users_guide/glasgow_exts.rst                  | 259 +++++++---
 docs/users_guide/using.rst                         |  11 +-
 .../InferDependency.hs                             |   0
 .../tests/dependent/should_compile/T14066a.stderr  |   2 +-
 .../tests/dependent/should_compile/T14880-2.hs     |  13 +
 .../tests/dependent/should_compile/T14880-2.stderr |  12 +
 testsuite/tests/dependent/should_compile/T14880.hs |  15 +
 testsuite/tests/dependent/should_compile/T15743.hs |   7 +
 .../tests/dependent/should_compile/T15743.stderr   |   6 +
 .../tests/dependent/should_compile/T15743e.hs      |  21 +
 .../tests/dependent/should_compile/T15743e.stderr  |  32 ++
 testsuite/tests/dependent/should_compile/all.T     |   5 +
 .../dependent/should_fail/InferDependency.stderr   |  10 -
 .../tests/dependent/should_fail/SelfDep.stderr     |   1 +
 .../tests/dependent/should_fail/T13895.stderr      |  14 +-
 .../tests/dependent/should_fail/T14066d.stderr     |   2 +-
 .../tests/dependent/should_fail/T14066e.stderr     |  12 +-
 testsuite/tests/dependent/should_fail/T15591b.hs   |   9 +
 .../tests/dependent/should_fail/T15591b.stderr     |   7 +
 testsuite/tests/dependent/should_fail/T15591c.hs   |   9 +
 .../tests/dependent/should_fail/T15591c.stderr     |   7 +
 testsuite/tests/dependent/should_fail/T15743c.hs   |  11 +
 .../tests/dependent/should_fail/T15743c.stderr     |  16 +
 testsuite/tests/dependent/should_fail/T15743d.hs   |  10 +
 .../tests/dependent/should_fail/T15743d.stderr     |  16 +
 testsuite/tests/dependent/should_fail/all.T        |   5 +-
 testsuite/tests/ghci/scripts/T15591.hs             |  16 +
 testsuite/tests/ghci/scripts/T15591.script         |   4 +
 testsuite/tests/ghci/scripts/T15591.stdout         |   4 +
 testsuite/tests/ghci/scripts/T15743b.hs            |   6 +
 testsuite/tests/ghci/scripts/T15743b.script        |   3 +
 testsuite/tests/ghci/scripts/T15743b.stdout        |   1 +
 testsuite/tests/ghci/scripts/T6018ghcifail.stderr  |   2 +-
 testsuite/tests/ghci/scripts/all.T                 |   1 +
 .../tests/indexed-types/should_fail/T14175.stderr  |   1 +
 .../tests/patsyn/should_compile/T14394.stdout      |   2 +-
 .../{should_fail => should_compile}/T14552.hs      |   0
 testsuite/tests/patsyn/should_compile/all.T        |   1 +
 testsuite/tests/patsyn/should_fail/T14552.stderr   |   9 -
 testsuite/tests/patsyn/should_fail/all.T           |   1 -
 testsuite/tests/polykinds/PolyKinds06.stderr       |   9 +-
 testsuite/tests/polykinds/T13625.stderr            |   1 +
 testsuite/tests/polykinds/T14846.stderr            |  18 +-
 testsuite/tests/polykinds/T15592.hs                |   2 +-
 testsuite/tests/polykinds/T7524.stderr             |   2 +-
 .../should_compile/ExplicitForAllRules1.stderr     |  10 +
 .../tests/typecheck/should_fail/T14350.stderr      |  10 +-
 .../tests/typecheck/should_fail/T6018fail.stderr   |   2 +-
 .../typecheck/should_fail/T6018failclosed.stderr   |   4 +-
 testsuite/tests/typecheck/should_fail/T7892.stderr |   4 +-
 86 files changed, 1600 insertions(+), 950 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 5e45ad10ffca1ad175b10f6ef3327e1ed8ba25f3


More information about the ghc-commits mailing list