Skip to content

Conversation

jckarter
Copy link
Contributor

@jckarter jckarter commented Mar 7, 2018

If a property or subscript is referenceable from other modules, we need to give it a descriptor so that we can reliably build an equivalent key path in or out of that module.

There are some cases that we should handle but don't yet:

  • Global and static properties ought to be key-path-able someday, so we should make descriptors for them, but this might need a new key path component kind.
  • Subscripts with indexes that aren't Hashable in the current module ought to get descriptors too, in case we ever support non-hashable key path components, and also because a generic subscript might be substituted with Hashable types by an external user, or an external module might post-hoc extend a type to be Hashable, so we really need to change things so that the client supplies the hashing and equality implementations for the indexes instead of the descriptor.

@jckarter
Copy link
Contributor Author

jckarter commented Mar 7, 2018

@swift-ci Please smoke test

If a property or subscript is referenceable from other modules, we need to give it a descriptor so that we can reliably build an equivalent key path in or out of that module.

There are some cases that we should handle but don't yet:

- Global and static properties ought to be key-path-able someday, so we should make descriptors for them, but this might need a new key path component kind.
- Subscripts with indexes that aren't Hashable in the current module ought to get descriptors too, in case we ever support non-hashable key path components, and also because a generic subscript might be substituted with Hashable types by an external user, or an external module might post-hoc extend a type to be Hashable, so we really need to change things so that the client supplies the hashing and equality implementations for the indexes instead of the descriptor.
@jckarter jckarter force-pushed the keypath-resilience-silgen branch from ce3aa6d to a8e3c4f Compare March 7, 2018 23:32
@jckarter
Copy link
Contributor Author

jckarter commented Mar 7, 2018

@swift-ci Please smoke test

@jckarter jckarter merged commit 2d194e7 into swiftlang:master Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant