-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal for Keypath #644
Proposal for Keypath #644
Conversation
proposals/XXXX-key-paths.md
Outdated
|
||
let firstFriendsNameKeyPath = Person.friends[0].name | ||
|
||
let firstFriend = luke[path] // han |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be let firstFriend = luke[firstFriendsNameKeyPath]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it should. That was a Last Minute Change™ where the find-replace failed. :(
- fix example so that it compiles - move to #keyPath syntax - add a parameter label for the subscripts - various prose tweaks to account for the above
You have this:
Does this not conflict with backward compatibility?
|
This, along with other spelling matters regarding of this is being discussed on the swift-evolution list.
…-Michael
On Mar 31, 2017, at 4:07 AM, Denis Bredelet ***@***.***> wrote:
You have this:
// or equivalently, with type inferred from context
luke[keyPath: #keyPath(.friends[0].name)]
Does this not conflict with backward compatibility?
There is no change or interaction with the #keyPath() syntax introduced in Swift 3. #keyPath(Person.bestFriend.name) will still produce a String
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#644 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/APaPv1iV-aWMV4UOYnSvpQcDnpjfNuQWks5rrN5sgaJpZM4Mg2Rx>.
|
No description provided.