build errors
Kazu Yamamoto (=?iso-2022-jp?B?GyRCOzNLXE9CSScbKEI=?=)
kazu at iij.ad.jp
Fri Nov 29 02:30:56 UTC 2013
Hi,
> I cannot build GHC head on Linux and Mac (Mavericks) today:
>
> compiler/typecheck/TcEvidence.lhs:152:16:
> Not in scope: data constructor `ASSERT2'
The attached patches are necessary to build GHC head on Mavericks.
--Kazu
diff --git a/compiler/coreSyn/CoreUtils.lhs b/compiler/coreSyn/CoreUtils.lhs
index 91f68a2..9e23348 100644
--- a/compiler/coreSyn/CoreUtils.lhs
+++ b/compiler/coreSyn/CoreUtils.lhs
@@ -190,7 +190,7 @@ applyTypeToArgs e op_ty args
-- | Wrap the given expression in the coercion safely, dropping
-- identity coercions and coalescing nested coercions
mkCast :: CoreExpr -> Coercion -> CoreExpr
-mkCast e co | ASSERT2 ( coercionRole co == Representational
+mkCast e co | ASSERT2( coercionRole co == Representational
, ptext (sLit "coercion") <+> ppr co <+> ptext (sLit "passed to mkCast") <+> ppr e <+> ptext (sLit "has wrong role") <+> ppr (coercionRole co) )
isReflCo co = e
diff --git a/compiler/deSugar/DsBinds.lhs b/compiler/deSugar/DsBinds.lhs
index 9866453..5764d11 100644
--- a/compiler/deSugar/DsBinds.lhs
+++ b/compiler/deSugar/DsBinds.lhs
@@ -705,7 +705,7 @@ dsHsWrapper (WpTyApp ty) e = return $ App e (Type ty)
dsHsWrapper (WpLet ev_binds) e = do bs <- dsTcEvBinds ev_binds
return (mkCoreLets bs e)
dsHsWrapper (WpCompose c1 c2) e = dsHsWrapper c1 =<< dsHsWrapper c2 e
-dsHsWrapper (WpCast co) e = ASSERT (tcCoercionRole co == Representational)
+dsHsWrapper (WpCast co) e = ASSERT(tcCoercionRole co == Representational)
dsTcCoercion co (mkCast e)
dsHsWrapper (WpEvLam ev) e = return $ Lam ev e
dsHsWrapper (WpTyLam tv) e = return $ Lam tv e
diff --git a/compiler/typecheck/TcCanonical.lhs b/compiler/typecheck/TcCanonical.lhs
index d51fbf6..8f60bc5 100644
--- a/compiler/typecheck/TcCanonical.lhs
+++ b/compiler/typecheck/TcCanonical.lhs
@@ -1132,7 +1132,7 @@ canEqLeafTyVar ev tv s2 -- ev :: tv ~ s2
(Just tv1, Just tv2) | tv1 == tv2
-> do { when (isWanted ev) $
- ASSERT ( tcCoercionRole co == Nominal )
+ ASSERT( tcCoercionRole co == Nominal )
setEvBind (ctev_evar ev) (mkEvCast (EvCoercion (mkTcReflCo Nominal xi1)) (mkTcSubCo co))
; return Stop }
diff --git a/compiler/typecheck/TcEvidence.lhs b/compiler/typecheck/TcEvidence.lhs
index 6b1ee3e..c233d71 100644
--- a/compiler/typecheck/TcEvidence.lhs
+++ b/compiler/typecheck/TcEvidence.lhs
@@ -149,7 +149,7 @@ mkTcTyConAppCo role tc cos -- No need to expand type synonyms
-- mkSubCo will do some normalisation. We do not do it for TcCoercions, but
-- defer that to desugaring; just to reduce the code duplication a little bit
mkTcSubCo :: TcCoercion -> TcCoercion
-mkTcSubCo co = ASSERT2 ( tcCoercionRole co == Nominal, ppr co)
+mkTcSubCo co = ASSERT2( tcCoercionRole co == Nominal, ppr co)
TcSubCo co
maybeTcSubCo2_maybe :: Role -- desired role
@@ -171,7 +171,7 @@ maybeTcSubCo2 r1 r2 co
mkTcAxInstCo :: Role -> CoAxiom br -> Int -> [TcType] -> TcCoercion
mkTcAxInstCo role ax index tys
- | ASSERT2 ( not (role == Nominal && ax_role == Representational) , ppr (ax, tys) )
+ | ASSERT2( not (role == Nominal && ax_role == Representational) , ppr (ax, tys) )
arity == n_tys = maybeTcSubCo2 role ax_role $ TcAxiomInstCo ax_br index rtys
| otherwise = ASSERT( arity < n_tys )
maybeTcSubCo2 role ax_role $
@@ -486,7 +486,7 @@ c <.> WpHole = c
c1 <.> c2 = c1 `WpCompose` c2
mkWpCast :: TcCoercion -> HsWrapper
-mkWpCast co = ASSERT2 (tcCoercionRole co == Representational, ppr co)
+mkWpCast co = ASSERT2(tcCoercionRole co == Representational, ppr co)
WpCast co
mkWpTyApps :: [Type] -> HsWrapper
@@ -709,7 +709,7 @@ The story for kind `Symbol` is analogous:
\begin{code}
mkEvCast :: EvTerm -> TcCoercion -> EvTerm
mkEvCast ev lco
- | ASSERT2 (tcCoercionRole lco == Representational, (vcat [ptext (sLit "Coercion of wrong role passed to mkEvCast:"), ppr ev, ppr lco]))
+ | ASSERT2(tcCoercionRole lco == Representational, (vcat [ptext (sLit "Coercion of wrong role passed to mkEvCast:"), ppr ev, ppr lco]))
isTcReflCo lco = ev
| otherwise = EvCast ev lco
diff --git a/compiler/typecheck/TcSMonad.lhs b/compiler/typecheck/TcSMonad.lhs
index 90fe446..06856d7 100644
--- a/compiler/typecheck/TcSMonad.lhs
+++ b/compiler/typecheck/TcSMonad.lhs
@@ -1708,7 +1708,7 @@ rewriteCtFlavor (CtGiven { ctev_evtm = old_tm , ctev_loc = loc }) new_pred co
rewriteCtFlavor (CtWanted { ctev_evar = evar, ctev_loc = loc }) new_pred co
= do { new_evar <- newWantedEvVar loc new_pred
- ; MASSERT ( tcCoercionRole co == Nominal )
+ ; MASSERT( tcCoercionRole co == Nominal )
; setEvBind evar (mkEvCast (getEvTerm new_evar) (mkTcSubCo co))
; case new_evar of
Fresh ctev -> return (Just ctev)
More information about the ghc-devs
mailing list