[commit: ghc] ghc-8.0: Add `PatSynSigSkol` and modify `PatSynCtxt` (13a54bc)
git at git.haskell.org
git at git.haskell.org
Thu Mar 24 22:00:20 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.0
Link : http://ghc.haskell.org/trac/ghc/changeset/13a54bc3526df1f13c717ec80456743d9bbe6656/ghc
>---------------------------------------------------------------
commit 13a54bc3526df1f13c717ec80456743d9bbe6656
Author: Rik Steenkamp <rik at ewps.nl>
Date: Wed Mar 23 16:17:27 2016 +0100
Add `PatSynSigSkol` and modify `PatSynCtxt`
As the type of a pattern synonym cannot in general be represented by a
value of type Type, we cannot use a value `SigSkol (PatSynCtxt n) (Check
ty)` to represent the signature of a pattern synonym (this causes
incorrect signatures to be printed in error messages). Therefore we now
represent it by a value `PatSynSigSkol n` (instead of incorrect
signatures we simply print no explicit signature).
Furthermore, we rename `PatSynCtxt` to `PatSynBuilderCtxt`, and use
`SigSkol (PatSynBuilderCtxt n) (Check ty)` to represent the type of a
bidirectional pattern synonym when used in an expression context.
Before, this type was represented by a value `SigSkol (PatSynCtxt n)
(Check ty)`, which caused incorrect error messages.
Also, in `mk_dict_err` of `typecheck\TcErrors.hs` we now distinguish
between all enclosing implications and "useful" enclosing implications,
for better error messages concerning pattern synonyms. See `Note [Useful
implications]`.
See the Phabricator page for examples.
Reviewers: mpickering, goldfire, simonpj, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1967
GHC Trac Issues: #11667
(cherry picked from commit 997312b04c56017197250096d61f3e8fab502319)
>---------------------------------------------------------------
13a54bc3526df1f13c717ec80456743d9bbe6656
compiler/basicTypes/PatSyn.hs | 15 ++++
compiler/typecheck/TcErrors.hs | 88 ++++++++++++++++--------
compiler/typecheck/TcPatSyn.hs | 5 +-
compiler/typecheck/TcRnTypes.hs | 7 ++
compiler/typecheck/TcSimplify.hs | 4 +-
compiler/typecheck/TcType.hs | 17 ++---
compiler/typecheck/TcValidity.hs | 38 +++++-----
testsuite/tests/patsyn/should_fail/T10873.stderr | 9 ++-
testsuite/tests/patsyn/should_fail/T11039.stderr | 4 +-
testsuite/tests/patsyn/should_fail/T11667.hs | 31 +++++++++
testsuite/tests/patsyn/should_fail/T11667.stderr | 43 ++++++++++++
testsuite/tests/patsyn/should_fail/all.T | 1 +
12 files changed, 194 insertions(+), 68 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 13a54bc3526df1f13c717ec80456743d9bbe6656
More information about the ghc-commits
mailing list