Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
3c8e76dc
Commit
3c8e76dc
authored
Apr 19, 2007
by
mnislaih
Browse files
add some DEBUG assertions
parent
cf48cf64
Changes
2
Hide whitespace changes
Inline
Side-by-side
compiler/basicTypes/DataCon.lhs
View file @
3c8e76dc
...
...
@@ -644,10 +644,12 @@ dataConInstArgTys :: DataCon
-- NB: these INCLUDE the existentially quantified dict args
-- but EXCLUDE the data-decl context which is discarded
-- It's all post-flattening etc; this is a representation type
dataConInstArgTys (MkData {dcRepArgTys = arg_tys,
dcUnivTyVars = univ_tvs,
dcExTyVars = ex_tvs}) inst_tys
= ASSERT( length tyvars == length inst_tys )
dataConInstArgTys dc@(MkData {dcRepArgTys = arg_tys,
dcUnivTyVars = univ_tvs,
dcExTyVars = ex_tvs}) inst_tys
= ASSERT2 ( length tyvars == length inst_tys
, ptext SLIT("dataConInstArgTys") <+> ppr dc $$ ppr tyvars $$ ppr inst_tys)
map (substTyWith tyvars inst_tys) arg_tys
where
tyvars = univ_tvs ++ ex_tvs
...
...
@@ -656,9 +658,10 @@ dataConInstArgTys (MkData {dcRepArgTys = arg_tys,
-- And the same deal for the original arg tys
dataConInstOrigArgTys :: DataCon -> [Type] -> [Type]
dataConInstOrigArgTys dc@(MkData {dcOrigArgTys = arg_tys,
dcUnivTyVars = univ_tvs,
dcExTyVars = ex_tvs}) inst_tys
= ASSERT2( length tyvars == length inst_tys, ptext SLIT("dataConInstOrigArgTys") <+> ppr dc <+> ppr inst_tys )
dcUnivTyVars = univ_tvs,
dcExTyVars = ex_tvs}) inst_tys
= ASSERT2( length tyvars == length inst_tys
, ptext SLIT("dataConInstOrigArgTys") <+> ppr dc $$ ppr tyvars $$ ppr inst_tys )
map (substTyWith tyvars inst_tys) arg_tys
where
tyvars = univ_tvs ++ ex_tvs
...
...
compiler/ghci/RtClosureInspect.hs
View file @
3c8e76dc
...
...
@@ -555,11 +555,12 @@ cvObtainTerm1 hsc_env force mb_ty hval = runTR hsc_env $ do
-- correct order.
reOrderTerms
_
_
[]
=
[]
reOrderTerms
pointed
unpointed
(
ty
:
tys
)
|
isPointed
ty
=
head
pointed
:
reOrderTerms
(
tailSafe
"reorderTerms1"
pointed
)
unpointed
tys
|
otherwise
=
head
unpointed
:
reOrderTerms
pointed
(
tailSafe
"reorderTerms2"
unpointed
)
tys
tailSafe
msg
[]
=
error
msg
tailSafe
_
(
x
:
xs
)
=
xs
|
isPointed
ty
=
ASSERT2
(
not
(
null
pointed
)
,
ptext
SLIT
(
"reOrderTerms"
)
$$
(
ppr
pointed
$$
ppr
unpointed
))
head
pointed
:
reOrderTerms
(
tail
pointed
)
unpointed
tys
|
otherwise
=
ASSERT2
(
not
(
null
unpointed
)
,
ptext
SLIT
(
"reOrderTerms"
)
$$
(
ppr
pointed
$$
ppr
unpointed
))
head
unpointed
:
reOrderTerms
pointed
(
tail
unpointed
)
tys
isMonomorphic
=
isEmptyVarSet
.
tyVarsOfType
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment