2 ms·
But how is that an issue? I guess when you are casting random integer to the enum-type without any checks?
by Semaphor 5y ago
But how is that an issue? I guess when you are casting random integer to the enum-type without any checks?
- masklinn 5y ago> But how is that an issue? I guess when you are casting random integer to the enum-type without any checks? Any caller can send any garbage (if you're publishing a package / API), likewise a dependency can return any garbage, etc... C#'s enums are entirely indicative.
- Semaphor 5y agoThen you have the default path, throwing an exception. I don’t see how that is different from accessing an array with an OOB index.