[commit: ghc] master: Remove special case from TcTyVar level check (49a832d)

git at git.haskell.org git at git.haskell.org
Wed May 23 14:11:33 UTC 2018


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

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

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

commit 49a832dd38bb87dc5f6c865e86a60319b44fdf5a
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed May 23 13:14:50 2018 +0100

    Remove special case from TcTyVar level check
    
    In TcMType.writeMetaTyVarRef we have an assertion
    check, level_check_ok, that the type being written
    to a unification variable is not deeper than the level
    of the unification varaible itself.
    
    This check used to have a special case for fmv/fsk
    flatten vars, but this commit changed fmv/fsks to have
    an ordinary level number:
    
        commit 2bbdd00c6d70bdc31ff78e2a42b26159c8717856
        Author: Simon Peyton Jones <simonpj at microsoft.com>
        Date:   Fri May 18 08:43:11 2018 +0100
    
        Orient TyVar/TyVar equalities with deepest on the left
    
    So we can delete the isFlattenTyVar special case from
    the level_check_ok assertion.  Simpler, less ad hoc.


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

49a832dd38bb87dc5f6c865e86a60319b44fdf5a
 compiler/typecheck/TcMType.hs | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/compiler/typecheck/TcMType.hs b/compiler/typecheck/TcMType.hs
index 398d345..e4e9854 100644
--- a/compiler/typecheck/TcMType.hs
+++ b/compiler/typecheck/TcMType.hs
@@ -754,8 +754,7 @@ writeMetaTyVarRef tyvar ref ty
     tv_lvl = tcTyVarLevel tyvar
     ty_lvl = tcTypeLevel ty
 
-    level_check_ok = isFlattenTyVar tyvar
-                  || not (ty_lvl `strictlyDeeperThan` tv_lvl)
+    level_check_ok  = not (ty_lvl `strictlyDeeperThan` tv_lvl)
     level_check_msg = ppr ty_lvl $$ ppr tv_lvl $$ ppr tyvar $$ ppr ty
 
     double_upd_msg details = hang (text "Double update of meta tyvar")



More information about the ghc-commits mailing list