2 ms·
One thing that annoys me about enums is that I'm always afraid that I'll write code like @enum MyEnum A B sometest = x == A ? B Which is correct but t
by bdjsiqoocwk 2y ago
One thing that annoys me about enums is that I'm always afraid that I'll write code like
@enum MyEnum A B
sometest = x == A ? B
Which is correct but that one that I'll add new elements to the enum
@enum MyEnum A B C
and forget to check if that code is still correct. Suggestions?
- mrkeen 2y agoPattern-match over them and don't use a catch-all clause. Let your compiler emit warnings for unhandled cases.