I switched a feature from enum to a sealed class, which is great because now my objects can extend different interfaces depending on what they are.
There is only one drawback: I need the list of all objects. Using enum, I used MyEnum.values(), but now I am maintaining a list of all objects.
Here is a related topic on stack overflow: https://stackoverflow.com/questions/44784328/how-to-obtain-all-subclasses-of-a-given-sealed-class (Personally I prefer to maintain the list than using nested classes and reflection).
My suggestion is to add a “SealedClass.objects()” function that provides all “object” instances that extends the sealed class.
By the way, thanks for the great work with Kotlin, I love the language!