[Git][ghc/ghc][master] Fix assertion failures reported in #16533

Marge Bot gitlab at gitlab.haskell.org
Sun Apr 14 05:26:33 UTC 2019



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
6febc444 by Krzysztof Gogolewski at 2019-04-14T05:20:29Z
Fix assertion failures reported in #16533

- - - - -


4 changed files:

- compiler/typecheck/TcCanonical.hs
- compiler/typecheck/TcSigs.hs
- compiler/types/OptCoercion.hs
- compiler/types/Type.hs


Changes:

=====================================
compiler/typecheck/TcCanonical.hs
=====================================
@@ -1015,7 +1015,7 @@ can_eq_nc_forall ev eq_rel s1 s2
             -- Done: unify phi1 ~ phi2
             go [] subst bndrs2
               = ASSERT( null bndrs2 )
-                unify loc (eqRelRole eq_rel) phi1' (substTy subst phi2)
+                unify loc (eqRelRole eq_rel) phi1' (substTyUnchecked subst phi2)
 
             go _ _ _ = panic "cna_eq_nc_forall"  -- case (s:ss) []
 


=====================================
compiler/typecheck/TcSigs.hs
=====================================
@@ -515,7 +515,7 @@ tcInstSig hs_sig@(PartialSig { psig_hs_ty = hs_ty
                              , sig_inst_skols = tv_prs
                              , sig_inst_wcs   = wcs
                              , sig_inst_wcx   = wcx
-                             , sig_inst_theta = substTys subst theta
+                             , sig_inst_theta = substTysUnchecked subst theta
                              , sig_inst_tau   = substTyUnchecked  subst tau }
        ; traceTc "End partial sig }" (ppr inst_sig)
        ; return inst_sig }


=====================================
compiler/types/OptCoercion.hs
=====================================
@@ -118,8 +118,8 @@ optCoercion' env co
         (Pair in_ty1  in_ty2,  in_role)  = coercionKindRole co
         (Pair out_ty1 out_ty2, out_role) = coercionKindRole out_co
     in
-    ASSERT2( substTy env in_ty1 `eqType` out_ty1 &&
-             substTy env in_ty2 `eqType` out_ty2 &&
+    ASSERT2( substTyUnchecked env in_ty1 `eqType` out_ty1 &&
+             substTyUnchecked env in_ty2 `eqType` out_ty2 &&
              in_role == out_role
            , text "optCoercion changed types!"
              $$ hang (text "in_co:") 2 (ppr co)


=====================================
compiler/types/Type.hs
=====================================
@@ -1044,7 +1044,7 @@ piResultTys ty orig_args@(arg:args)
     init_subst = mkEmptyTCvSubst $ mkInScopeSet (tyCoVarsOfTypes (ty:orig_args))
 
     go :: TCvSubst -> Type -> [Type] -> Type
-    go subst ty [] = substTy subst ty
+    go subst ty [] = substTyUnchecked subst ty
 
     go subst ty all_args@(arg:args)
       | Just ty' <- coreView ty



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/6febc444c0abea6c033174aa0e813c950b9b2877

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/6febc444c0abea6c033174aa0e813c950b9b2877
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190414/1b9b8eb5/attachment-0001.html>


More information about the ghc-commits mailing list