Provide a type reflection API for Swift.

Originator:oliver
Number:rdar://17447442 Date Originated:2014-06-25
Status:Open Resolved:
Product:Developer Tools Product Version:6.0 (6A216f)
Classification:Enhancement Reproducible:Always
 
Strongly typed languages like C# and Java can provide reflection APIs.  Even C++ has a simple runtime type information system.

Objective-C has a fairly rich run time type information system (not as good as C#).  

Swift should provide a rich run time type information (Reflection) API similar to C#'s.

As a developer I should be able to enumerate all types defined in a Swift executable.  I should be able to enumerate all the methods and properties of a Swift type.  I should be able to get at all the parameters, return values (and types there of) of a method or property.

I should then also be able to invoke a method or read/write a property of an object using the method information returned from the reflection API.

For reference: C#'s Reflection API: http://msdn.microsoft.com/en-us/library/gg145033(v=vs.110).aspx

Steps to Reproduce:
N/A

Expected Results:
That there be a rich reflection API in Swift.

Actual Results:
There appears to be none.

Version:
6.0 (6A216f)

Notes:


Configuration:
N/A

Attachments:

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!