You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, the fact that you're required to write a whole other class just to add a method to the enum seems a little big ridiculous to me. I'm not going to go as far as to suggest that an enum should be a full-fledged class (that has already been suggested in #274), but the capacity to do things which are already legal through extensions seems reasonable.
The text was updated successfully, but these errors were encountered:
Currently, it's not possible to define a method inside of an enum. This, for example, or anything like it does not compile:
It is possible to emulate this effect using extensions:
However, the fact that you're required to write a whole other class just to add a method to the enum seems a little big ridiculous to me. I'm not going to go as far as to suggest that an enum should be a full-fledged class (that has already been suggested in #274), but the capacity to do things which are already legal through extensions seems reasonable.
The text was updated successfully, but these errors were encountered: