summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-03-29 14:57:16 +0000
committerIan Lynagh <igloo@earth.li>2008-03-29 14:57:16 +0000
commitc26717e6713bf1037a065ae5d89f98b109f87fab (patch)
treeb202dd9ed72d270f4f6e4689d01a80beb7423f90
parent72d043c04c1b0db0896e2c876a1544434f0428ec (diff)
downloadhaskell-c26717e6713bf1037a065ae5d89f98b109f87fab.tar.gz
Remove more #ifdef DEBUGs
-rw-r--r--compiler/types/Type.lhs12
1 files changed, 3 insertions, 9 deletions
diff --git a/compiler/types/Type.lhs b/compiler/types/Type.lhs
index 67b58a3726..d5c00e8070 100644
--- a/compiler/types/Type.lhs
+++ b/compiler/types/Type.lhs
@@ -1272,11 +1272,9 @@ mkOpenTvSubst env = TvSubst (mkInScopeSet (tyVarsOfTypes (varEnvElts env))) env
zipOpenTvSubst :: [TyVar] -> [Type] -> TvSubst
zipOpenTvSubst tyvars tys
-#ifdef DEBUG
- | length tyvars /= length tys
+ | debugIsOn && (length tyvars /= length tys)
= pprTrace "zipOpenTvSubst" (ppr tyvars $$ ppr tys) emptyTvSubst
| otherwise
-#endif
= TvSubst (mkInScopeSet (tyVarsOfTypes tys)) (zipTyEnv tyvars tys)
-- mkTopTvSubst is called when doing top-level substitutions.
@@ -1287,20 +1285,16 @@ mkTopTvSubst prs = TvSubst emptyInScopeSet (mkVarEnv prs)
zipTopTvSubst :: [TyVar] -> [Type] -> TvSubst
zipTopTvSubst tyvars tys
-#ifdef DEBUG
- | length tyvars /= length tys
+ | debugIsOn && (length tyvars /= length tys)
= pprTrace "zipTopTvSubst" (ppr tyvars $$ ppr tys) emptyTvSubst
| otherwise
-#endif
= TvSubst emptyInScopeSet (zipTyEnv tyvars tys)
zipTyEnv :: [TyVar] -> [Type] -> TvSubstEnv
zipTyEnv tyvars tys
-#ifdef DEBUG
- | length tyvars /= length tys
+ | debugIsOn && (length tyvars /= length tys)
= pprTrace "mkTopTvSubst" (ppr tyvars $$ ppr tys) emptyVarEnv
| otherwise
-#endif
= zip_ty_env tyvars tys emptyVarEnv
-- Later substitutions in the list over-ride earlier ones,