use $new for singleton enums with extends clause (and no mixins) #17814
bishabosha
started this conversation in
Feature Requests
Replies: 0 comments 1 reply
-
previously, as soon as a singleton enum case requires to pass parameters to its parent, an anonymous class is generated for the case - which seems unnecessary when there is no variance except for passed parameters |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
for the cases of singleton enum values where the enum definition has parameters, it would make sense to add those parameters to the
$new
creator method. This would make thePlanets
example require only three classes, (Planet
,Planet$
, and one anon class for the implementation) and not one class for each planet.This can not be extended to cases that mixin other traits, these will still need individual anonymous classes.
Beta Was this translation helpful? Give feedback.
All reactions