Closed iluuu1994 closed 3 years ago
I had intended for both, because I couldn't think of a use case for them. But that's a good one. Should we allow static methods on both, or just on the Enum?
Should we allow static methods on both, or just on the Enum?
I'd say just on enums, there's no obvious way to invoke them on enum cases (other than through the instance in which case they could just be an instance method in the first place).
Added that, and an example of using a "named constructor" for an enum to demonstrate it.
Thank you :)
The RFC says:
Any specific reason this shouldn't be allowed? Also, are we talking about enums or the enum cases?
Example where this would be useful: