Swift Pitch: Reflection
I propose adding a new module to the Swift toolchain named
Reflection
that provides high level APIs for reflection in Swift. This makes use of reflective information that has always been available, but was never exposed as API until now.[…]
[
Mirror
] works great, but there is a serious issue here in that it requires an instance of the type you want to introspect over.[…]
Swift introduces a new module,
Reflection
, with a whole new suite of high level APIs that make working with reflection easier, more ergonomic, and provides developers with much more information than what they had.
Previously:
- swift-reflection-dump
- How Swift’s Mirror Works
- Swift’s Reflective Underpinnings
- Dynamic Swift
- MirrorType
- Simple Reflection in Swift