3 ms·
The author misses I think an important point regarding enums: using a union type instead means you can't iterate the list of valid values without restating them
by shadowgovt 5y ago
The author misses I think an important point regarding enums: using a union type instead means you can't iterate the list of valid values without restating them in the value domain in a non-DRY fashion. The reason enum generates code is that it is both a type construct and a value construct... That ends up being useful in myriad contexts.