X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypes%2FGenerics.lhs;fp=ghc%2Fcompiler%2Ftypes%2FGenerics.lhs;h=744b667980e98a0f7a9455329000112ab62efdb6;hb=07c456df1f21bb2291a18ada0e2d749f1ea52c17;hp=d961aa8e4ea8204aa18fda959a06c478d1d47789;hpb=c1f3fad183f553aa46ec9dea33999f387014fded;p=ghc-hetmet.git diff --git a/ghc/compiler/types/Generics.lhs b/ghc/compiler/types/Generics.lhs index d961aa8..744b667 100644 --- 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 + | 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