Reflect aims to expose the powerful runtime type info included in your swift binaries in an interface similar to that of Golangs reflect.
Currenctly we have support for:
- Struct types
- Mangled name
- Fields
- Count
- Offsets
- Names
- Types
- isGeneric
- Tuple types
- Elements
- Count
- Offsets
- Labels (currently not included in the ABI)
- Types
- Elements
- Enum types
- isGeneric
- isOptional
- Mangled name
- Cases
- Number of cases (with and without payloads)
- Payload size offset
- Case names
- Case types
- isIndirect
- Protocol Composition types (Existentials)
- Mangled names
- hasClassConstraint (
protocol Foo: class
) - Number of protocols in composition
- isAnyType
- inherited protocol list
- objc compatibility information
- size
- flags
- Swift defined
- dispatch via witness table or objc_msgSend
- Generic Parameter Types (and WitnessTables if constrained)
- Function Types
- Argument Types
- Result Type
- isArgumentInout
- Class types
- isGeneric
- Fields
- Count
- Offsets
- Names
- Types
- Destructor
- Super Type
- Instance Address
- Instance Size
- Instance aligment mask
- VTable