[commit: ghc] ghc-8.6: Fail fast on pattern synonyms (3e05006)

git at git.haskell.org git at git.haskell.org
Wed Oct 17 18:46:38 UTC 2018


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

On branch  : ghc-8.6
Link       : http://ghc.haskell.org/trac/ghc/changeset/3e050064511ce67ee9150d51cb9db487187be39e/ghc

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

commit 3e050064511ce67ee9150d51cb9db487187be39e
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)


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

3e050064511ce67ee9150d51cb9db487187be39e
 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 3e050064511ce67ee9150d51cb9db487187be39e


More information about the ghc-commits mailing list