Quickly written together in inim:
nim> type A = enum
nim> import std/sequtils
nim> A.items.toSeq()
@[B, C] == type seq[A]
RunYou need to to `toSeq` an iterator that iterates over the enum. The `items` iterator is implicitly called when using a for-loop on an enum (and a lot of other types, if not most/all of them), that's why you don't have to explicitly type `for x in A.items` in your for-loop example.
