[swift-dev] Questions about _Reflectable and CustomReflectable
Austin Zheng
austinzheng at gmail.com
Tue Dec 8 13:44:07 CST 2015
Hello devs,
I have two questions about the _Reflectable and CustomReflectable protocols in the stdlib. (These are both in context of Jira ticket SR-88.)
First, I notice that _Reflectable encompasses both CustomReflectable and CustomPlaygroundQuickLookable's functionality. It looks like there are a couple of _MirrorTypes that exist only to provide quicklook functionality. Can I assume that, quicklook behavior aside, a _MirrorType conformer that is hardcoded to report zero children can be replaced by the default runtime mirror (e.g. the type who the _FoobarMirrorType belongs to doesn't need to conform to CustomReflectable)?
Secondly, is there an explicit replacement for _MirrorType's "summary" property? As-is, the current Mirror type provides no analogous property, and in most cases the existing custom mirrors just return the object's description. Was the "reflection summary" functionality broken out into a third protocol, or dropped altogether?
Best regards,
Austin
More information about the swift-dev
mailing list