Commit 07c456df authored by simonmar's avatar simonmar
Browse files

[project @ 2002-04-10 13:09:39 by simonmar]

(from Simon P.J) Make generics work with zero-constructor datatypes.
parent c1f3fad1
......@@ -254,8 +254,12 @@ mkTyConGenInfo tycon [from_name, to_name]
| dc <- datacons ]
= Nothing
| null datacons -- There are no constructors;
= Nothing -- there are no values of this type
| 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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment