Is there a simple way to iterate over all enumerated instances of a class in Ceylon?
Just like values()
for Java enums?
abstract class Suit(
This can be done now with ClassOrInterface.caseValues:
Suit[] suits = `Suit`.caseValues;
Regarding the returned sequence:
This sequence is ordered and skips any case type to only include case values.
One way is to use the metamodel:
for (caseType in `class Suit`.caseTypes) {
assert (is OpenClassOrInterfaceType caseType);
print(caseType.declaration.name);
}