[commit: ghc] master: Remove decideKindGeneralisationPlan (c955a51)
git at git.haskell.org
git at git.haskell.org
Thu Aug 2 20:42:19 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/c955a514f033a12f6d0ab0fbacec3e18a5757ab5/ghc
>---------------------------------------------------------------
commit c955a514f033a12f6d0ab0fbacec3e18a5757ab5
Author: Richard Eisenberg <rae at cs.brynmawr.edu>
Date: Sat Jul 14 16:02:13 2018 -0400
Remove decideKindGeneralisationPlan
TypeInType came with a new function: decideKindGeneralisationPlan.
This type-level counterpart to the term-level decideGeneralisationPlan
chose whether or not a kind should be generalized. The thinking was
that if `let` should not be generalized, then kinds shouldn't either
(under the same circumstances around -XMonoLocalBinds).
However, this is too conservative -- the situation described in the
motivation for "let should be be generalized" does not occur in types.
This commit thus removes decideKindGeneralisationPlan, always
generalizing.
One consequence is that tc_hs_sig_type_and_gen no longer calls
solveEqualities, which reports all unsolved constraints, instead
relying on the solveLocalEqualities in tcImplicitTKBndrs. An effect
of this is that reporing kind errors gets delayed more frequently.
This seems to be a net benefit in error reporting; often, alongside
a kind error, the type error is now reported (and users might find
type errors easier to understand).
Some of these errors ended up at the top level, where it was
discovered that the GlobalRdrEnv containing the definitions in the
local module was not in the TcGblEnv, and thus errors were reported
with qualified names unnecessarily. This commit rejiggers some of
the logic around captureTopConstraints accordingly.
One error message (typecheck/should_fail/T1633)
is a regression, mentioning the name of a default method. However,
that problem is already reported as #10087, its solution is far from
clear, and so I'm not addressing it here.
This commit fixes #15141. As it's an internal refactor, there is
no concrete test case for it.
Along the way, we no longer need the hsib_closed field of
HsImplicitBndrs (it was used only in decideKindGeneralisationPlan)
and so it's been removed, simplifying the datatype structure.
Along the way, I removed code in the validity checker that looks
at coercions. This isn't related to this patch, really (though
it was, at one point), but it's an improvement, so I kept it.
This updates the haddock submodule.
>---------------------------------------------------------------
c955a514f033a12f6d0ab0fbacec3e18a5757ab5
compiler/deSugar/DsMeta.hs | 10 +-
compiler/hsSyn/HsTypes.hs | 31 ++--
compiler/rename/RnSource.hs | 5 +-
compiler/rename/RnTypes.hs | 19 +-
compiler/typecheck/TcDeriv.hs | 7 +-
compiler/typecheck/TcEnv.hs | 6 +-
compiler/typecheck/TcHsType.hs | 204 +++++++++++----------
compiler/typecheck/TcInstDcls.hs | 5 +-
compiler/typecheck/TcMType.hs | 2 +
compiler/typecheck/TcRnDriver.hs | 54 +++---
compiler/typecheck/TcSigs.hs | 9 +-
compiler/typecheck/TcSimplify.hs | 23 ++-
compiler/typecheck/TcSplice.hs | 2 +-
compiler/typecheck/TcTyClsDecls.hs | 7 +-
compiler/typecheck/TcValidity.hs | 37 +---
compiler/types/TyCoRep.hs | 40 +++-
docs/users_guide/glasgow_exts.rst | 43 -----
.../{should_fail => should_compile}/T14066h.hs | 2 +-
testsuite/tests/dependent/should_compile/all.T | 1 +
.../tests/dependent/should_fail/DepFail1.stderr | 22 ++-
.../tests/dependent/should_fail/T13895.stderr | 24 +++
.../tests/dependent/should_fail/T14066.stderr | 6 +-
.../tests/dependent/should_fail/T14066e.stderr | 11 +-
.../tests/dependent/should_fail/T14066h.stderr | 16 --
testsuite/tests/dependent/should_fail/all.T | 1 -
.../parser/should_compile/DumpRenamedAst.stderr | 16 +-
testsuite/tests/polykinds/T11142.stderr | 13 +-
testsuite/tests/polykinds/T11516.hs | 1 +
testsuite/tests/polykinds/T11516.stderr | 2 +-
testsuite/tests/polykinds/T11520.hs | 2 +-
testsuite/tests/polykinds/T11520.stderr | 4 +
testsuite/tests/polykinds/T12593.stderr | 58 ++++--
testsuite/tests/polykinds/T13555.stderr | 20 --
testsuite/tests/polykinds/T14520.hs | 2 +-
testsuite/tests/polykinds/T14520.stderr | 3 +-
testsuite/tests/polykinds/T14846.stderr | 15 +-
testsuite/tests/polykinds/T7224.stderr | 8 +-
testsuite/tests/polykinds/T8616.stderr | 14 +-
testsuite/tests/polykinds/all.T | 4 +-
testsuite/tests/rename/should_fail/T5951.stderr | 4 +
testsuite/tests/rename/should_fail/rnfail026.hs | 7 +-
.../tests/rename/should_fail/rnfail026.stderr | 8 +-
testsuite/tests/th/T5358.stderr | 20 --
testsuite/tests/typecheck/should_compile/T15141.hs | 35 ++++
testsuite/tests/typecheck/should_compile/all.T | 1 +
.../tests/typecheck/should_fail/T11112.stderr | 12 +-
.../tests/typecheck/should_fail/T11563.stderr | 6 +
.../tests/typecheck/should_fail/T14232.stderr | 13 ++
testsuite/tests/typecheck/should_fail/T1633.stderr | 6 +-
testsuite/tests/typecheck/should_fail/T2994.stderr | 13 ++
testsuite/tests/typecheck/should_fail/T3540.stderr | 10 +
testsuite/tests/typecheck/should_fail/T7778.stderr | 6 +
.../tests/typecheck/should_fail/tcfail057.stderr | 12 +-
.../tests/typecheck/should_fail/tcfail058.stderr | 23 ++-
.../tests/typecheck/should_fail/tcfail063.stderr | 20 +-
.../tests/typecheck/should_fail/tcfail078.stderr | 13 ++
.../tests/typecheck/should_fail/tcfail113.stderr | 21 +++
.../tests/typecheck/should_fail/tcfail158.stderr | 7 +-
.../tests/typecheck/should_fail/tcfail160.stderr | 9 +-
.../tests/typecheck/should_fail/tcfail161.stderr | 11 +-
.../tests/typecheck/should_fail/tcfail212.stderr | 26 ++-
utils/haddock | 2 +-
62 files changed, 620 insertions(+), 414 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 c955a514f033a12f6d0ab0fbacec3e18a5757ab5
More information about the ghc-commits
mailing list