{"action":"created","issue":{"url":"https://api.github.com/repos/apple/swift/issues/23436","repository_url":"https://api.github.com/repos/apple/swift","labels_url":"https://api.github.com/repos/apple/swift/issues/23436/labels{/name}","comments_url":"https://api.github.com/repos/apple/swift/issues/23436/comments","events_url":"https://api.github.com/repos/apple/swift/issues/23436/events","html_url":"https://github.com/apple/swift/pull/23436","id":423029630,"node_id":"MDExOlB1bGxSZXF1ZXN0MjYyNjkyMDA4","number":23436,"title":"[SE-0252][TypeChecker] Keypath Dynamic Member Lookup","user":{"login":"xedin","id":21240,"node_id":"MDQ6VXNlcjIxMjQw","avatar_url":"https://avatars1.githubusercontent.com/u/21240?v=4","gravatar_id":"","url":"https://api.github.com/users/xedin","html_url":"https://github.com/xedin","followers_url":"https://api.github.com/users/xedin/followers","following_url":"https://api.github.com/users/xedin/following{/other_user}","gists_url":"https://api.github.com/users/xedin/gists{/gist_id}","starred_url":"https://api.github.com/users/xedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xedin/subscriptions","organizations_url":"https://api.github.com/users/xedin/orgs","repos_url":"https://api.github.com/users/xedin/repos","events_url":"https://api.github.com/users/xedin/events{/privacy}","received_events_url":"https://api.github.com/users/xedin/received_events","type":"User","site_admin":false},"labels":[{"id":303289391,"node_id":"MDU6TGFiZWwzMDMyODkzOTE=","url":"https://api.github.com/repos/apple/swift/labels/swift-evolution-approved","name":"swift-evolution-approved","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":25,"created_at":"2019-03-20T01:53:48Z","updated_at":"2019-04-03T19:30:43Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/23436","html_url":"https://github.com/apple/swift/pull/23436","diff_url":"https://github.com/apple/swift/pull/23436.diff","patch_url":"https://github.com/apple/swift/pull/23436.patch"},"body":"Implement keypath based dynamic member lookup which augments\r\nfunctionality of existing @dynamicMemberLookup attribute.\r\n\r\nTwo new subscript overloads are accepted:\r\n\r\n```swift\r\nsubscript(dynamicMember member: KeyPath<T, ...>) -> ...\r\nsubscript(dynamicmember member: WritableKeyPath<T, ...>) -> ...\r\n```\r\n\r\n**Example**:\r\n\r\n```swift\r\nstruct Point {\r\n  let x: Int\r\n  var y: Int\r\n}\r\n\r\n@dynamicMemberLookup \r\nstruct Lens<T> {\r\n  var obj: T\r\n\r\n  init(_ obj: T) {\r\n    self.obj = obj\r\n  }\r\n\r\n  subscript<U>(dynamicMember member: KeyPath<T, U>) -> Lens<U> {\r\n    get { return Lens<U>(obj[keyPath: member]) }\r\n  }\r\n\r\n  subscript<U>(dynamicMember member: WritableKeyPath<T, U>) -> Lens<U> {\r\n    get { return Lens<U>(obj[keyPath: member]) }\r\n    set { obj[keyPath: member] = newValue.obj }\r\n  }\r\n}\r\n\r\nvar lens = Lens(Point(x: 0, y: 0))\r\n\r\n_ = lens.x // converted into `lens[dynamicMember: KeyPath<Point, Int>`\r\n_ = lens.y = Lens(10) // converted into `lens[dynamicMember: WritableKeyPath<Point, Int>]`\r\n```\r\n\r\nResolves: rdar://problem/49069813\r\nResolves: rdar://problem/49533404\r\n\r\n<!--\r\nBefore merging this pull request, you must run the Swift continuous integration tests.\r\nFor information about triggering CI builds via @swift-ci, see:\r\nhttps://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci\r\n\r\nThank you for your contribution to Swift!\r\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/apple/swift/issues/comments/479627416","html_url":"https://github.com/apple/swift/pull/23436#issuecomment-479627416","issue_url":"https://api.github.com/repos/apple/swift/issues/23436","id":479627416,"node_id":"MDEyOklzc3VlQ29tbWVudDQ3OTYyNzQxNg==","user":{"login":"swift-ci","id":15467072,"node_id":"MDQ6VXNlcjE1NDY3MDcy","avatar_url":"https://avatars0.githubusercontent.com/u/15467072?v=4","gravatar_id":"","url":"https://api.github.com/users/swift-ci","html_url":"https://github.com/swift-ci","followers_url":"https://api.github.com/users/swift-ci/followers","following_url":"https://api.github.com/users/swift-ci/following{/other_user}","gists_url":"https://api.github.com/users/swift-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/swift-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swift-ci/subscriptions","organizations_url":"https://api.github.com/users/swift-ci/orgs","repos_url":"https://api.github.com/users/swift-ci/repos","events_url":"https://api.github.com/users/swift-ci/events{/privacy}","received_events_url":"https://api.github.com/users/swift-ci/received_events","type":"User","site_admin":false},"created_at":"2019-04-03T19:30:43Z","updated_at":"2019-04-03T19:30:43Z","author_association":"CONTRIBUTOR","body":"**Build failed**\n[Swift Test Linux Platform](https://ci.swift.org/job/swift-PR-Linux/12288/)\nGit Sha - bc4d01620bcfa83e3c9fd09c71a8a39471870733\n"}}
{"actor":{"display_login":"swift-ci"}}