Closed bwoebi closed 3 years ago
I'm not sure. Allowing them later on would be much easier than removing them.
I'm inclined to say no. The purpose of enums is not to be classes per se; that's an implementation detail. Their purpose is to define types that are themselves fully defining their meaning by virtue of being types. The only data of any kind that should be needed is for ADTs/Associated Values. Beyond that, the type definition itself is supposed to be where the design decisions lives.
I don't know what you'd even do with constants or static properties on the EnumType.
If you have static methods… why wouldn't you have static properties?
On constants, their use case could be defining mappings between enum and primitive values.
We've decided against constants. I'm not yet totally sure about static properties but I'm also tending towards no. I'll close this issue for now.
We permit static methods … do we also permit constants (on enum decls, anyway not on cases; should be stated explicitly in the RFC though)? Should be symmetrical, but not sure about possible confusions. And in the same thought train, static properties?