projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tighten up what it means to be an "enumeration data constructor"
[ghc-hetmet.git]
/
compiler
/
iface
/
BuildTyCl.lhs
diff --git
a/compiler/iface/BuildTyCl.lhs
b/compiler/iface/BuildTyCl.lhs
index
4319d1f
..
e71eefe
100644
(file)
--- a/
compiler/iface/BuildTyCl.lhs
+++ b/
compiler/iface/BuildTyCl.lhs
@@
-112,10
+112,14
@@
mkDataTyConRhs :: [DataCon] -> AlgTyConRhs
mkDataTyConRhs cons
= DataTyCon {
data_cons = cons,
mkDataTyConRhs cons
= DataTyCon {
data_cons = cons,
- is_enum = not (null cons) &&
- all isNullarySrcDataCon cons
+ is_enum = not (null cons) && all is_enum_con cons
-- See Note [Enumeration types] in TyCon
}
-- 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
mkNewTyConRhs :: Name -> TyCon -> DataCon -> TcRnIf m n AlgTyConRhs
-- ^ Monadic because it makes a Name for the coercion TyCon