Proposal: Declaring an enum restricted by a number,string or boolean set
jbondc opened this issue · 5 comments
jbondc commented
Withdrawn
danquirk commented
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.
jbondc commented
@danquirk About your mention of other languages, made a weird discovery Pascal has 'set types':
http://en.wikipedia.org/wiki/Pascal_(programming_language)#Set_types
Updated the proposal with links. This should be super familiar to @ahejlsberg 😮