[commit: ghc] master: Fail fast on pattern synonyms (9ebfa03)

git at git.haskell.org git at git.haskell.org
Thu Oct 4 15:04:03 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/9ebfa03d9e9cbf79f698b5d4bd39e799e4e9a02c/ghc

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

commit 9ebfa03d9e9cbf79f698b5d4bd39e799e4e9a02c
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.


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

9ebfa03d9e9cbf79f698b5d4bd39e799e4e9a02c
 compiler/typecheck/TcBinds.hs                    |  3 +-
 compiler/typecheck/TcExpr.hs                     |  4 +-
 compiler/typecheck/TcPatSyn.hs                   | 75 +++++++++++++-----------
 compiler/typecheck/TcRnDriver.hs                 | 19 +++---
 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, 165 insertions(+), 98 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 9ebfa03d9e9cbf79f698b5d4bd39e799e4e9a02c


More information about the ghc-commits mailing list