# Introspection of KeyPaths

**URL:** <https://forums.swift.org/t/introspection-of-keypaths/36879>\
**Category:** Discussion\
**Created:** [May 26, 2020, 1:11pm UTC](https://forums.swift.org/t/introspection-of-keypaths/36879 "2020-05-26T13:11:01Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![lightsprint09](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lightsprint09/32/6561_2.png) [@lightsprint09](https://forums.swift.org/u/lightsprint09)\
**Post date:** [May 29, 2020, 6:31am UTC](https://forums.swift.org/t/introspection-of-keypaths/36879/19 "2020-05-29T06:31:29Z")

</div>

While building a CRDT ([see](https://forums.swift.org/t/query-into-dynamic-data-using-static-key-paths/36728/4), I considered writing a similar proposal. During resarch I came up with the following questions.

1. Computed members.  
Should one be able to introspect a key path and get information if the introspected member is computed?  
Should the compiler give us a way to reference key paths, which must not contain computed members

2. Subscripts  
While members could be represented a strings, how should we represent subscript?  
As far as I know, a subscript can be called with any type.  
Is a subscript similar to a computed member or not.

3. Optionals  
Should one be able to get information if a member is optional.

---

_[View the full topic](https://forums.swift.org/t/introspection-of-keypaths/36879)._
