[commit: ghc] master: Allow TyVars in TcTypes (18d0bdd)

git at git.haskell.org git at git.haskell.org
Fri Nov 25 11:30:45 UTC 2016


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

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

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

commit 18d0bdd3848201882bae167e3b15fd797d217e93
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Nov 23 16:00:00 2016 +0000

    Allow TyVars in TcTypes
    
    Up to now we've had a rule that a TyVar can't apppear in a type
    seen by the type checker; they should all be TcTyVars.  But:
    
    a) With -XTypeInType it becomes much harder to exclude them;
       see Note [TcTyVars in the typechecker] in TcType.
    
    b) It's unnecessary to exculde them; instead we can just treat
       a TyVar just like vanillaSkolemTv.
    
    This is what was causing an ASSERT error in
    indexed-types/should_fail/T12041, reported in Trac #12826.
    
    That patch allows a TyVar in a TcType.  The most significant
    change is to make Var.tcTyVarDetails return vanillaSkolemTv.
    In fact it already did, but (a) it was not documented, and
    (b) we never exploited it.  Now we rely on it.


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

18d0bdd3848201882bae167e3b15fd797d217e93
 compiler/basicTypes/Var.hs                      | 16 +++---
 compiler/typecheck/TcErrors.hs                  |  5 +-
 compiler/typecheck/TcType.hs                    | 76 +++++++++++++++++++------
 compiler/typecheck/TcUnify.hs                   | 11 ++--
 compiler/types/InstEnv.hs                       |  4 +-
 testsuite/tests/indexed-types/should_fail/all.T |  3 +-
 6 files changed, 76 insertions(+), 39 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 18d0bdd3848201882bae167e3b15fd797d217e93


More information about the ghc-commits mailing list