[commit: ghc] master: Exclude TyVars from the constraint solver (7496be5)

git at git.haskell.org git at git.haskell.org
Fri Feb 26 17:14:46 UTC 2016


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

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

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

commit 7496be5c0ab96bcc9ab70ab873aa561674b7789d
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Feb 26 09:02:07 2016 +0000

    Exclude TyVars from the constraint solver
    
    There is a general invariant that the constraint solver doesn't see
    TyVars, only TcTyVars.  But when checking the generic-default
    signature of a class, we called checkValidType on the generic-default
    type, which had the class TyVar free. That in turn meant that it wasn't
    considered during flattening, which led to the error reported in
    Trac #11608.
    
    The fix is simple: call checkValidType on the /closed/ type. Easy.
    
    While I was at it, I added a bunch of ASSERTs about the TcTyVar
    invariant.


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

7496be5c0ab96bcc9ab70ab873aa561674b7789d
 compiler/typecheck/TcErrors.hs                     | 49 ++++++++++++++-------
 compiler/typecheck/TcTyClsDecls.hs                 | 16 +++++--
 compiler/typecheck/TcType.hs                       | 50 +++++++++++++++-------
 testsuite/tests/typecheck/should_compile/T11608.hs | 14 ++++++
 testsuite/tests/typecheck/should_compile/all.T     |  1 +
 5 files changed, 96 insertions(+), 34 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 7496be5c0ab96bcc9ab70ab873aa561674b7789d


More information about the ghc-commits mailing list