X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fiface%2FBuildTyCl.lhs;h=e71eefe33925a35c1b148f8dbc7bb04b3fe71f1f;hb=5463b55b7dadc1e9918edb2d8666bf3ed195bc61;hp=de57feb928e1b9d9f689f392c701c3f25aa01819;hpb=d2ce0f52d42edf32bb9f13796e6ba6edba8bd516;p=ghc-hetmet.git diff --git a/compiler/iface/BuildTyCl.lhs b/compiler/iface/BuildTyCl.lhs index de57feb..e71eefe 100644 --- a/compiler/iface/BuildTyCl.lhs +++ b/compiler/iface/BuildTyCl.lhs @@ -112,16 +112,14 @@ mkDataTyConRhs :: [DataCon] -> AlgTyConRhs mkDataTyConRhs cons = DataTyCon { data_cons = cons, - is_enum = -- We define datatypes with no constructors to not be - -- enumerations; this fixes trac #2578, Otherwise we - -- end up generating an empty table for - -- __closure_tbl - -- which is used by tagToEnum# to map Int# to constructors - -- in an enumeration. The empty table apparently upset - -- the linker. - not (null cons) && - all isNullarySrcDataCon cons + is_enum = not (null cons) && all is_enum_con cons + -- See Note [Enumeration types] in TyCon } + where + is_enum_con con + | (_tvs, theta, arg_tys, _res) <- dataConSig con + = null theta && null arg_tys + mkNewTyConRhs :: Name -> TyCon -> DataCon -> TcRnIf m n AlgTyConRhs -- ^ Monadic because it makes a Name for the coercion TyCon