diff options
Diffstat (limited to 'compiler/GHC/Tc/Solver/Canonical.hs')
-rw-r--r-- | compiler/GHC/Tc/Solver/Canonical.hs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/compiler/GHC/Tc/Solver/Canonical.hs b/compiler/GHC/Tc/Solver/Canonical.hs index e4020bdfc5..9e47c6ce8d 100644 --- a/compiler/GHC/Tc/Solver/Canonical.hs +++ b/compiler/GHC/Tc/Solver/Canonical.hs @@ -39,6 +39,7 @@ import GHC.Types.Var.Env( mkInScopeSet ) import GHC.Types.Var.Set( delVarSetList, anyVarSet ) import GHC.Utils.Outputable import GHC.Utils.Panic +import GHC.Utils.Panic.Plain import GHC.Builtin.Types ( anyTypeOfKind ) import GHC.Driver.Session( DynFlags ) import GHC.Types.Name.Set @@ -208,7 +209,7 @@ canClass :: CtEvidence canClass ev cls tys pend_sc fds = -- all classes do *nominal* matching - ASSERT2( ctEvRole ev == Nominal, ppr ev $$ ppr cls $$ ppr tys ) + assertPpr (ctEvRole ev == Nominal) (ppr ev $$ ppr cls $$ ppr tys) $ do { (xis, cos) <- rewriteArgsNom ev cls_tc tys ; let co = mkTcTyConAppCo Nominal cls_tc cos xi = mkClassPred cls xis @@ -503,8 +504,8 @@ makeSuperClasses cts = concatMapM go cts go (CDictCan { cc_ev = ev, cc_class = cls, cc_tyargs = tys }) = mkStrictSuperClasses ev [] [] cls tys go (CQuantCan (QCI { qci_pred = pred, qci_ev = ev })) - = ASSERT2( isClassPred pred, ppr pred ) -- The cts should all have - -- class pred heads + = assertPpr (isClassPred pred) (ppr pred) $ -- The cts should all have + -- class pred heads mkStrictSuperClasses ev tvs theta cls tys where (tvs, theta, cls, tys) = tcSplitDFunTy (ctEvPred ev) @@ -596,7 +597,7 @@ mk_strict_superclasses rec_clss ev tvs theta cls tys | otherwise -- Wanted/Derived case, just add Derived superclasses -- that can lead to improvement. - = ASSERT2( null tvs && null theta, ppr tvs $$ ppr theta ) + = assertPpr (null tvs && null theta) (ppr tvs $$ ppr theta) $ concatMapM do_one_derived (immSuperClasses cls tys) where loc = ctEvLoc ev @@ -1214,7 +1215,7 @@ can_eq_nc_forall ev eq_rel s1 s2 -- Done: unify phi1 ~ phi2 go [] subst bndrs2 - = ASSERT( null bndrs2 ) + = assert (null bndrs2 ) unify loc (eqRelRole eq_rel) phi1' (substTyUnchecked subst phi2) go _ _ _ = panic "cna_eq_nc_forall" -- case (s:ss) [] @@ -1851,7 +1852,7 @@ canDecomposableTyConAppOK :: CtEvidence -> EqRel -> TcS (StopOrContinue Ct) -- Precondition: tys1 and tys2 are the same length, hence "OK" canDecomposableTyConAppOK ev eq_rel tc tys1 tys2 - = ASSERT( tys1 `equalLength` tys2 ) + = assert (tys1 `equalLength` tys2) $ do { traceTcS "canDecomposableTyConAppOK" (ppr ev $$ ppr eq_rel $$ ppr tc $$ ppr tys1 $$ ppr tys2) ; case ev of @@ -2508,7 +2509,7 @@ instance Outputable CanEqOK where -- TyEq:H: Checked here. canEqOK :: DynFlags -> EqRel -> CanEqLHS -> Xi -> CanEqOK canEqOK dflags eq_rel lhs rhs - = ASSERT( good_rhs ) + = assert good_rhs $ case checkTypeEq dflags YesTypeFamilies lhs rhs of CTE_OK -> CanEqOK CTE_Bad -> CanEqNotOK OtherCIS @@ -3037,7 +3038,7 @@ rewriteEvidence ev@(CtWanted { ctev_dest = dest -- The "_SI" variant ensures that we make a new Wanted -- with the same shadow-info as the existing one -- with the same shadow-info as the existing one (#16735) - ; MASSERT( tcCoercionRole co == ctEvRole ev ) + ; massert (tcCoercionRole co == ctEvRole ev) ; setWantedEvTerm dest (mkEvCast (getEvExpr mb_new_ev) (tcDowngradeRole Representational (ctEvRole ev) co)) |