{"action":"created","issue":{"url":"https://api.github.com/repos/apple/swift/issues/4087","repository_url":"https://api.github.com/repos/apple/swift","labels_url":"https://api.github.com/repos/apple/swift/issues/4087/labels{/name}","comments_url":"https://api.github.com/repos/apple/swift/issues/4087/comments","events_url":"https://api.github.com/repos/apple/swift/issues/4087/events","html_url":"https://github.com/apple/swift/pull/4087","id":169830369,"node_id":"MDExOlB1bGxSZXF1ZXN0ODAzODYwODg=","number":4087,"title":"[Foundation] Add hack enabling factory intializer","user":{"login":"rintaro","id":142081,"node_id":"MDQ6VXNlcjE0MjA4MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/142081?v=4","gravatar_id":"","url":"https://api.github.com/users/rintaro","html_url":"https://github.com/rintaro","followers_url":"https://api.github.com/users/rintaro/followers","following_url":"https://api.github.com/users/rintaro/following{/other_user}","gists_url":"https://api.github.com/users/rintaro/gists{/gist_id}","starred_url":"https://api.github.com/users/rintaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rintaro/subscriptions","organizations_url":"https://api.github.com/users/rintaro/orgs","repos_url":"https://api.github.com/users/rintaro/repos","events_url":"https://api.github.com/users/rintaro/events{/privacy}","received_events_url":"https://api.github.com/users/rintaro/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-08-08T02:02:25Z","updated_at":"2018-12-07T09:52:31Z","closed_at":"2018-12-07T09:52:31Z","author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/4087","html_url":"https://github.com/apple/swift/pull/4087","diff_url":"https://github.com/apple/swift/pull/4087.diff","patch_url":"https://github.com/apple/swift/pull/4087.patch"},"body":"#### What's in this pull request?\n\nI'm not sure this can be accepted or not.\nBut this is convenient in some cases.\n\nUsing that:\n- Simplify copy constructor of `NSSet` and `NSDictionary`\n- Eliminate `getVaList` from `init(format: ..)` initalizer of `NSPredicate`, `NSExpression` and `NSString`\n\n---\n\n<!-- This selection should only be completed by Swift admin -->\n\nBefore merging this pull request to apple/swift repository:\n- [ ] Test pull request on Swift continuous integration.\n\n<details>\n  <summary>\n\nTriggering Swift CI</summary>\n\n\n\nThe swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:\n\n**Smoke Testing**\n\n| Platform | Comment |\n| --- | --- |\n| All supported platforms | @swift-ci Please smoke test |\n| All supported platforms | @swift-ci Please smoke test and merge |\n| OS X platform | @swift-ci Please smoke test OS X platform |\n| Linux platform | @swift-ci Please smoke test Linux platform |\n\nA smoke test on macOS does the following:\n1. Builds the compiler incrementally.\n2. Builds the standard library only for macOS. Simulator standard libraries and\n   device standard libraries are not built.\n3. lldb is not built.\n4. The test and validation-test targets are run only for macOS. The optimized\n   version of these tests are not run.\n\nA smoke test on Linux does the following:\n1. Builds the compiler incrementally.\n2. Builds the standard library incrementally.\n3. lldb is built incrementally.\n4. The swift test and validation-test targets are run. The optimized version of these\n   tests are not run.\n5. lldb is tested.\n\n**Validation Testing**\n\n| Platform | Comment |\n| --- | --- |\n| All supported platforms | @swift-ci Please test |\n| All supported platforms | @swift-ci Please test and merge |\n| OS X platform | @swift-ci Please test OS X platform |\n| OS X platform | @swift-ci Please benchmark |\n| Linux platform | @swift-ci Please test Linux platform |\n\n**Lint Testing**\n\n| Language | Comment |\n| --- | --- |\n| Python | @swift-ci Please Python lint |\n\nNote: Only members of the Apple organization can trigger swift-ci.\n</details>\n\n<!-- Thank you for your contribution to Swift! -->\n"},"comment":{"url":"https://api.github.com/repos/apple/swift/issues/comments/445180127","html_url":"https://github.com/apple/swift/pull/4087#issuecomment-445180127","issue_url":"https://api.github.com/repos/apple/swift/issues/4087","id":445180127,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NTE4MDEyNw==","user":{"login":"rintaro","id":142081,"node_id":"MDQ6VXNlcjE0MjA4MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/142081?v=4","gravatar_id":"","url":"https://api.github.com/users/rintaro","html_url":"https://github.com/rintaro","followers_url":"https://api.github.com/users/rintaro/followers","following_url":"https://api.github.com/users/rintaro/following{/other_user}","gists_url":"https://api.github.com/users/rintaro/gists{/gist_id}","starred_url":"https://api.github.com/users/rintaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rintaro/subscriptions","organizations_url":"https://api.github.com/users/rintaro/orgs","repos_url":"https://api.github.com/users/rintaro/repos","events_url":"https://api.github.com/users/rintaro/events{/privacy}","received_events_url":"https://api.github.com/users/rintaro/received_events","type":"User","site_admin":false},"created_at":"2018-12-07T09:52:31Z","updated_at":"2018-12-07T09:52:31Z","author_association":"MEMBER","body":"We should revisit here when https://forums.swift.org/t/allow-self-x-in-class-convenience-initializers/15924 is implemented.\r\nCC: @jckarter @slavapestov @phausler \r\n\r\nWe cannot simply adapt this PR to the current code layout, because `type(of: self)` in closure are no longer allowed.\r\n```swift\r\n    self.init(_factory: {\r\n      type(of: self).init() // error: 'self' used before 'self.init' call\r\n    })\r\n```\r\nAlso, I found a couple of bugs which makes it difficult to adapt this PR to the current compiler.\r\nhttps://bugs.swift.org/browse/SR-9429\r\nhttps://bugs.swift.org/browse/SR-9430\r\n\r\nClosing for now."}}
{"actor":{"display_login":"rintaro"}}