X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fiface%2FBuildTyCl.lhs;h=de1c1915a67e37c4fd9ff0845ffc5c11dfc30393;hb=e9f9ec1e57d53b9302a395ce0d02c0fa59e28341;hp=ba383d8d1d0fb9f1c0b122b8e54eb9ab9545a946;hpb=703ca1542c8e0983cc9d8eebce6e9f3dd3fd71e2;p=ghc-hetmet.git diff --git a/compiler/iface/BuildTyCl.lhs b/compiler/iface/BuildTyCl.lhs index ba383d8..de1c191 100644 --- a/compiler/iface/BuildTyCl.lhs +++ b/compiler/iface/BuildTyCl.lhs @@ -118,7 +118,18 @@ mkOpenDataTyConRhs = OpenTyCon Nothing mkDataTyConRhs :: [DataCon] -> AlgTyConRhs mkDataTyConRhs cons - = DataTyCon { data_cons = cons, is_enum = all isNullarySrcDataCon 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 + } mkNewTyConRhs :: Name -> TyCon -> DataCon -> TcRnIf m n AlgTyConRhs -- Monadic because it makes a Name for the coercion TyCon