-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Proposal: Declaring an enum restricted by a number,string or boolean set #3105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm not sure this adds enough value for the complexity it introduces. Are there any other languages that support this kind of feature? It just adds bounds checking to numeric enums but doesn't scale to other enum spaces. We've had requests for string based enums for example which couldn't use this, we use bit flag enums ourselves a lot, and it's not unreasonable to imagine 'illegal' values within a contiguous bound which this wouldn't protect against. |
@danquirk About your mention of other languages, made a weird discovery Pascal has 'set types': Updated the proposal with links. This should be super familiar to @ahejlsberg 😮 |
@danquirk |
@jbondc Why the withdrawal? This was a good idea. |
@Gaelan I'm sure the TS team will come up with something. I've left the link to |
Withdrawn
The text was updated successfully, but these errors were encountered: