[commit: ghc] ghc-8.6: Fail fast on pattern synonyms (b4fdff4)
git at git.haskell.org
git at git.haskell.org
Wed Oct 17 18:45:09 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.6
Link : http://ghc.haskell.org/trac/ghc/changeset/b4fdff48d39941b3b811bf9c4860ac692922326e/ghc
>---------------------------------------------------------------
commit b4fdff48d39941b3b811bf9c4860ac692922326e
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Wed Oct 3 15:53:59 2018 +0100
Fail fast on pattern synonyms
We were recovering too eagerly from errors in pattern-synonym
type inference, leading to a cascade of confusing follow up errors
(Trac #15685, #15692).
The underlying issue is that a pattern synonym should have a closed,
fixed type, with no unification variables in it. But it wasn't!
Fixing this made me change the interface to simplifyInfer slightly.
Instead of /emitting/ a residual implication constraint, it
now /returns/ it, so that the caller can decide what to do.
(cherry picked from commit 9ebfa03d9e9cbf79f698b5d4bd39e799e4e9a02c)
>---------------------------------------------------------------
b4fdff48d39941b3b811bf9c4860ac692922326e
compiler/typecheck/TcBinds.hs | 3 +-
compiler/typecheck/TcExpr.hs | 4 +-
compiler/typecheck/TcPatSyn.hs | 75 +++++++++++++-----------
compiler/typecheck/TcRnDriver.hs | 21 +++----
compiler/typecheck/TcRnMonad.hs | 12 +++-
compiler/typecheck/TcRnTypes.hs | 37 +++++++-----
compiler/typecheck/TcSimplify.hs | 66 ++++++++++-----------
testsuite/tests/patsyn/should_fail/T15685.hs | 13 ++++
testsuite/tests/patsyn/should_fail/T15685.stderr | 10 ++++
testsuite/tests/patsyn/should_fail/T15692.hs | 9 +++
testsuite/tests/patsyn/should_fail/T15692.stderr | 13 ++++
testsuite/tests/patsyn/should_fail/all.T | 2 +
12 files changed, 166 insertions(+), 99 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 b4fdff48d39941b3b811bf9c4860ac692922326e
More information about the ghc-commits
mailing list