swift
4e39e59a - Add a field reflection function that constructs keypaths. (#34815)

Commit
4 years ago
Add a field reflection function that constructs keypaths. (#34815) While the existing _forEachField in ReflectionMirror.swift already gives the offsets and types for each field, this isn't enough information to construct a keypath for that field in order to modify it. For reference, this should be sufficent to implement the features described here: (https://forums.swift.org/t/storedpropertyiterable/19218/62) purely at runtime without any derived conformances for many types. Note: Since there isn't enough reflection information for `.mutatingGetSet` fields, this means that we're not able to support reflecting certain types of fields (functions, nonfinal class fields, etc). Whether this is an error or not is controlled by the `.ignoreUnknown` option.
Author
Parents
Loading