summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/Deriv.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Tc/Deriv.hs')
-rw-r--r--compiler/GHC/Tc/Deriv.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/GHC/Tc/Deriv.hs b/compiler/GHC/Tc/Deriv.hs
index a899349702..fa1a0afb45 100644
--- a/compiler/GHC/Tc/Deriv.hs
+++ b/compiler/GHC/Tc/Deriv.hs
@@ -61,6 +61,7 @@ import GHC.Types.SrcLoc
import GHC.Utils.Misc
import GHC.Utils.Outputable as Outputable
import GHC.Utils.Panic
+import GHC.Utils.Panic.Plain
import GHC.Utils.Logger
import GHC.Data.Bag
import GHC.Utils.FV as FV (fvVarList, unionFV, mkFVs)
@@ -1556,7 +1557,7 @@ mkNewTypeEqn newtype_strat dit@(DerivInstTys { dit_cls_tys = cls_tys
cant_derive_err = ppUnless eta_ok eta_msg
eta_msg = text "cannot eta-reduce the representation type enough"
- MASSERT( cls_tys `lengthIs` (classArity cls - 1) )
+ massert (cls_tys `lengthIs` (classArity cls - 1))
if newtype_strat
then
-- Since the user explicitly asked for GeneralizedNewtypeDeriving,
@@ -1962,7 +1963,7 @@ doDerivInstErrorChecks1 mechanism =
at_last_cls_tv_in_kind kind
= last_cls_tv `elemVarSet` exactTyCoVarsOfType kind
at_tcs = classATs cls
- last_cls_tv = ASSERT( notNull cls_tyvars )
+ last_cls_tv = assert (notNull cls_tyvars )
last cls_tyvars
cant_derive_err
@@ -2056,8 +2057,8 @@ genDerivStuff mechanism loc clas inst_tys tyvars
tyfam_insts <-
-- canDeriveAnyClass should ensure that this code can't be reached
-- unless -XDeriveAnyClass is enabled.
- ASSERT2( isValid (canDeriveAnyClass dflags)
- , ppr "genDerivStuff: bad derived class" <+> ppr clas )
+ assertPpr (isValid (canDeriveAnyClass dflags))
+ (ppr "genDerivStuff: bad derived class" <+> ppr clas) $
mapM (tcATDefault loc mini_subst emptyNameSet)
(classATItems clas)
return ( emptyBag, [] -- No method bindings are needed...