MirrorType on Enums has count == 0

Originator:alexito4
Number:rdar://21582676 Date Originated:28-Jun-2015 10:16 AM
Status:Open Resolved:
Product:Developer Tools Product Version:Swift 2.0 b2
Classification:Feature (New) Reproducible:Always
 
Summary:
Reflection on enums should provide information about each case. 

Steps to Reproduce:
See the attached playground.

Expected Results:
Be able to get a Mirror of the enum type and iterate over the cases to get information of the meta type. 

Actual Results:
mirror.count returns 0, so there is no way to get information about the cases. 

Regression:


Notes:
Enums are really powerful in Swift, but there are a couple of things missing. For example an .all method to get a Sequence with the cases or something similar. If the language itself doesn’t want to support that at least would be nice to have enough reflection powers to do it ourselves.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!