You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SR-30 Enumerations could have a "allValues" property
Issue Description:
Swift should be able to enumerate the cases of an enum. The machinery appears to be there, the case mirrors just need to be returned as children from the metatype Mirror. (Case mirrors already allow you to enumerate associated values as children.)
The text was updated successfully, but these errors were encountered:
Even in the case of a "simple" enum, this is still subject to the availability concerns I have in the case the compiler automagically derives an {code:java}allCases
@belkadan As long as the parameter space is finite (e.g. other enums without associated values), the semantics are clear (even though the list may become long). For infinite parameter spaces, lazy enumeration would still be possible in principle (unless we have floats), but arguably not very useful. So yes, if the compiler can not determine the full list (quickly?), this makes no sense.
Maybe the way to go is a protocol. We'd still have to implement it for ever enum, but at least there's be standard way to provide and access all values, if possible.
Additional Detail from JIRA
md5: abaa7fad97302a7f478a955d30d3dd52
relates to:
Issue Description:
Swift should be able to enumerate the cases of an enum. The machinery appears to be there, the case mirrors just need to be returned as children from the metatype Mirror. (Case mirrors already allow you to enumerate associated values as children.)
The text was updated successfully, but these errors were encountered: