Skip to content

Commit

Permalink
Some more ASSERTs
Browse files Browse the repository at this point in the history
Wed Sep 20 02:52:00 EDT 2006  Manuel M T Chakravarty <chak@cse.unsw.edu.au>
  * Some more ASSERTs
  • Loading branch information
mchakravarty committed Sep 20, 2006
1 parent defa8d1 commit 54c309c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion compiler/typecheck/TcMType.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion compiler/typecheck/TcType.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 54c309c

Please sign in to comment.