Commit 09d2b3b2 authored by Ian Lynagh's avatar Ian Lynagh

Fix trac #2578

We define empty datatypes as not being enumerations, which means the
empty blocks aren't generated.
parent d78b2eb7
......@@ -118,7 +118,13 @@ 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
not (null cons) &&
all isNullarySrcDataCon cons
}
mkNewTyConRhs :: Name -> TyCon -> DataCon -> TcRnIf m n AlgTyConRhs
-- Monadic because it makes a Name for the coercion 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