From: Manuel M T Chakravarty Date: Wed, 20 Sep 2006 18:54:32 +0000 (+0000) Subject: Some more ASSERTs X-Git-Tag: After_FC_branch_merge~4 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=54c309c0135eaa656f16d3abada41e5392a1fae0;p=ghc-hetmet.git Some more ASSERTs Wed Sep 20 02:52:00 EDT 2006 Manuel M T Chakravarty * Some more ASSERTs --- diff --git a/compiler/typecheck/TcMType.lhs b/compiler/typecheck/TcMType.lhs index 23c3381..f01d69d 100644 --- a/compiler/typecheck/TcMType.lhs +++ b/compiler/typecheck/TcMType.lhs @@ -368,7 +368,8 @@ data LookupTyVarResult -- The result of a lookupTcTyVar call lookupTcTyVar :: TcTyVar -> TcM LookupTyVarResult lookupTcTyVar tyvar - = case details of + = ASSERT( isTcTyVar tyvar ) + case details of SkolemTv _ -> return (DoneTv details) MetaTv _ ref -> do { meta_details <- readMutVar ref ; case meta_details of diff --git a/compiler/typecheck/TcType.lhs b/compiler/typecheck/TcType.lhs index 94ea3f9..f266f4b 100644 --- a/compiler/typecheck/TcType.lhs +++ b/compiler/typecheck/TcType.lhs @@ -399,6 +399,7 @@ mkKindName unique = mkSystemName unique kind_var_occ kindVarRef :: KindVar -> IORef MetaDetails kindVarRef tc = + ASSERT ( isTcTyVar tc ) case tcTyVarDetails tc of MetaTv TauTv ref -> ref other -> pprPanic "kindVarRef" (ppr tc) @@ -472,7 +473,8 @@ pprSkolTvBinding :: TcTyVar -> SDoc -- Print info about the binding of a skolem tyvar, -- or nothing if we don't have anything useful to say pprSkolTvBinding tv - = ppr_details (tcTyVarDetails tv) + = ASSERT ( isTcTyVar tv ) + ppr_details (tcTyVarDetails tv) where ppr_details (MetaTv TauTv _) = quotes (ppr tv) <+> ptext SLIT("is a meta type variable") ppr_details (MetaTv BoxTv _) = quotes (ppr tv) <+> ptext SLIT("is a boxy type variable")