[commit: ghc] master: Overhaul -fprint-explicit-kinds to use VKA (f5d2083)
git at git.haskell.org
git at git.haskell.org
Thu Nov 22 18:47:59 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/f5d2083807a03c57f194fcc3a7baf82e34aad524/ghc
>---------------------------------------------------------------
commit f5d2083807a03c57f194fcc3a7baf82e34aad524
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date: Thu Nov 22 11:55:00 2018 -0500
Overhaul -fprint-explicit-kinds to use VKA
This patch changes the behavior of `-fprint-explicit-kinds`
so that it displays kind argument using visible kind application.
In other words, the flag now:
1. Prints instantiations of specified variables with `@(...)`.
2. Prints instantiations of inferred variables with `@{...}`.
In addition, this patch removes the `Use -fprint-explicit-kinds to
see the kind arguments` error message that often arises when a type
mismatch occurs due to different kinds. Instead, whenever there is a
kind mismatch, we now enable the `-fprint-explicit-kinds` flag
locally to help cue to the programmer where the error lies.
(See `Note [Kind arguments in error messages]` in `TcErrors`.)
As a result, these funny `@{...}` things can now appear to the user
even without turning on the `-fprint-explicit-kinds` flag explicitly,
so I took the liberty of documenting them in the users' guide.
Test Plan: ./validate
Reviewers: goldfire, simonpj, bgamari
Reviewed By: simonpj
Subscribers: rwbarton, carter
GHC Trac Issues: #15871
Differential Revision: https://phabricator.haskell.org/D5314
>---------------------------------------------------------------
f5d2083807a03c57f194fcc3a7baf82e34aad524
compiler/backpack/RnModIface.hs | 4 +-
compiler/basicTypes/Var.hs | 2 +-
compiler/iface/IfaceSyn.hs | 7 +-
compiler/iface/IfaceType.hs | 224 +++++---
compiler/iface/ToIface.hs | 7 +-
compiler/typecheck/FamInst.hs | 9 +-
compiler/typecheck/FunDeps.hs | 6 +-
compiler/typecheck/TcErrors.hs | 78 ++-
compiler/typecheck/TcType.hs | 95 +++-
compiler/typecheck/TcValidity.hs | 48 +-
compiler/types/TyCoRep.hs | 17 +-
compiler/types/Type.hs | 4 +-
docs/users_guide/using.rst | 20 +-
.../tests/dependent/should_fail/T15825.stderr | 5 +-
.../tests/generics/T10604/T10604_deriving.stderr | 597 ++++++++++-----------
testsuite/tests/ghci/scripts/GhciKinds.stdout | 2 +-
testsuite/tests/ghci/scripts/T11376.stdout | 8 +-
testsuite/tests/ghci/scripts/T15341.stdout | 4 +-
testsuite/tests/ghci/scripts/T6018ghcifail.stderr | 14 +-
.../tests/indexed-types/should_fail/T9171.stderr | 7 +-
.../partial-sigs/should_compile/T15039b.stderr | 10 +-
.../partial-sigs/should_compile/T15039d.stderr | 10 +-
testsuite/tests/polykinds/T10570.stderr | 3 +-
testsuite/tests/polykinds/T14520.stderr | 2 +-
testsuite/tests/polykinds/T9144.stderr | 5 +-
testsuite/tests/polykinds/TidyClassKinds.stderr | 2 +-
.../tests/typecheck/should_fail/T15515.stderr | 3 +-
.../tests/typecheck/should_fail/T6018fail.stderr | 17 +-
.../typecheck/should_fail/T6018failclosed.stderr | 7 +-
29 files changed, 674 insertions(+), 543 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 f5d2083807a03c57f194fcc3a7baf82e34aad524
More information about the ghc-commits
mailing list