[commit: ghc] master: Fix top-level constraint handling (Trac #12921) (f5f6d42)

git at git.haskell.org git at git.haskell.org
Thu Jan 12 12:58:18 UTC 2017


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

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

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

commit f5f6d4237b87f5d0e3e0a05e4cfc52bb3c0e4ad9
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Jan 12 10:59:08 2017 +0000

    Fix top-level constraint handling (Trac #12921)
    
    Some out-of-scope errors were not being reported if anyone
    throws an un-caught exception in the TcM monad.  That led to
    
      ghc: panic! (the 'impossible' happened)
    	initTc: unsolved constraints
    
    I fixed this
    
    * Splitting captureConstraints to use an auxilliary
      tryCaptureConstraints (which never fails)
    
    * Define a new TcSimplify.captureTopConstraints (replacing
      the old TcRnMonad.captureTopConstraints), which reports
      any unsolved out-of-scope constraints before propagating
      the exception
    
    That in turn allowed me to do some tidying up of the static-constraint
    machinery, reducing duplication.
    
    Also solves #13106.


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

f5f6d4237b87f5d0e3e0a05e4cfc52bb3c0e4ad9
 compiler/typecheck/TcExpr.hs                       |   4 +-
 compiler/typecheck/TcRnDriver.hs                   |  27 ++--
 compiler/typecheck/TcRnMonad.hs                    | 148 +++++++++++----------
 compiler/typecheck/TcRnTypes.hs                    |   6 +-
 compiler/typecheck/TcSimplify.hs                   |  26 +++-
 testsuite/tests/typecheck/should_fail/T12921.hs    |   9 ++
 .../should_fail/T12921.stderr}                     |  26 ++--
 testsuite/tests/typecheck/should_fail/all.T        |   1 +
 8 files changed, 149 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 f5f6d4237b87f5d0e3e0a05e4cfc52bb3c0e4ad9


More information about the ghc-commits mailing list