projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2002-04-10 13:09:39 by simonmar]
[ghc-hetmet.git]
/
ghc
/
compiler
/
types
/
Generics.lhs
diff --git
a/ghc/compiler/types/Generics.lhs
b/ghc/compiler/types/Generics.lhs
index
d961aa8
..
744b667
100644
(file)
--- a/
ghc/compiler/types/Generics.lhs
+++ b/
ghc/compiler/types/Generics.lhs
@@
-254,8
+254,12
@@
mkTyConGenInfo tycon [from_name, to_name]
| dc <- datacons ]
= Nothing
| dc <- datacons ]
= Nothing
+ | null datacons -- There are no constructors;
+ = Nothing -- there are no values of this type
+
| otherwise
| otherwise
- = Just (EP { fromEP = mkVanillaGlobal from_name from_ty from_id_info,
+ = ASSERT( not (null datacons) ) -- mk_sum_stuff loops if no datacons
+ Just (EP { fromEP = mkVanillaGlobal from_name from_ty from_id_info,
toEP = mkVanillaGlobal to_name to_ty to_id_info })
where
maybe_datacons = tyConDataCons_maybe tycon
toEP = mkVanillaGlobal to_name to_ty to_id_info })
where
maybe_datacons = tyConDataCons_maybe tycon