{"action":"created","comment":{"url":"https://api.github.com/repos/apple/swift-protobuf/pulls/comments/83912922","pull_request_review_id":4724905,"id":83912922,"diff_hunk":"@@ -1929,11 +1903,23 @@ public struct Conformance_TestAllTypes: ProtobufGeneratedMessage {\n     get {return _storage._optionalNestedMessage ?? Conformance_TestAllTypes.NestedMessage()}\n     set {_uniqueStorage()._optionalNestedMessage = newValue}\n   }\n+  public var hasOptionalNestedMessage: Bool {\n+    return _storage._optionalNestedMessage != nil\n+  }\n+  public mutating func clearOptionalNestedMessage() {\n+    return _storage._optionalNestedMessage = nil\n+  }\n \n   public var optionalForeignMessage: Conformance_ForeignMessage {\n     get {return _storage._optionalForeignMessage ?? Conformance_ForeignMessage()}\n     set {_uniqueStorage()._optionalForeignMessage = newValue}\n   }\n+  public var hasOptionalForeignMessage: Bool {","path":"Reference/conformance/conformance.pb.swift","position":212,"original_position":212,"commit_id":"e1fe78ff99cc5deac45f6117b6e3efc4919f4f51","original_commit_id":"e1fe78ff99cc5deac45f6117b6e3efc4919f4f51","user":{"login":"allevato","id":1062427,"avatar_url":"https://avatars.githubusercontent.com/u/1062427?v=3","gravatar_id":"","url":"https://api.github.com/users/allevato","html_url":"https://github.com/allevato","followers_url":"https://api.github.com/users/allevato/followers","following_url":"https://api.github.com/users/allevato/following{/other_user}","gists_url":"https://api.github.com/users/allevato/gists{/gist_id}","starred_url":"https://api.github.com/users/allevato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allevato/subscriptions","organizations_url":"https://api.github.com/users/allevato/orgs","repos_url":"https://api.github.com/users/allevato/repos","events_url":"https://api.github.com/users/allevato/events{/privacy}","received_events_url":"https://api.github.com/users/allevato/received_events","type":"User","site_admin":false},"body":"Agreed, the dot-into behavior takes advantage of Swift's copy-on-write behavior in a really unique and clean way. Other languages effectively have this as well (Objective-C provides it automatically, C++ through the `mutable` methods, and so forth), but Swift's is probably the most elegant both in its user facing API and in its implementation because of the features of the language.","created_at":"2016-10-18T17:55:47Z","updated_at":"2016-10-18T17:55:47Z","html_url":"https://github.com/apple/swift-protobuf/pull/102#discussion_r83912922","pull_request_url":"https://api.github.com/repos/apple/swift-protobuf/pulls/102","_links":{"self":{"href":"https://api.github.com/repos/apple/swift-protobuf/pulls/comments/83912922"},"html":{"href":"https://github.com/apple/swift-protobuf/pull/102#discussion_r83912922"},"pull_request":{"href":"https://api.github.com/repos/apple/swift-protobuf/pulls/102"}}},"pull_request":{"url":"https://api.github.com/repos/apple/swift-protobuf/pulls/102","id":89649846,"html_url":"https://github.com/apple/swift-protobuf/pull/102","diff_url":"https://github.com/apple/swift-protobuf/pull/102.diff","patch_url":"https://github.com/apple/swift-protobuf/pull/102.patch","issue_url":"https://api.github.com/repos/apple/swift-protobuf/issues/102","number":102,"state":"open","locked":false,"title":"Generate non-optional properties for all fields.","user":{"login":"allevato","id":1062427,"avatar_url":"https://avatars.githubusercontent.com/u/1062427?v=3","gravatar_id":"","url":"https://api.github.com/users/allevato","html_url":"https://github.com/allevato","followers_url":"https://api.github.com/users/allevato/followers","following_url":"https://api.github.com/users/allevato/following{/other_user}","gists_url":"https://api.github.com/users/allevato/gists{/gist_id}","starred_url":"https://api.github.com/users/allevato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allevato/subscriptions","organizations_url":"https://api.github.com/users/allevato/orgs","repos_url":"https://api.github.com/users/allevato/repos","events_url":"https://api.github.com/users/allevato/events{/privacy}","received_events_url":"https://api.github.com/users/allevato/received_events","type":"User","site_admin":false},"body":"This updates the generator to generate non-optional properties for all fields, along with `has` properties and `clear` methods. Sadly this will increase the generated code size a little bit, but the alternative was not proto-behaviorally correct, so hopefully we can make that increase up elsewhere. In the future I hope that we can make this Swiftier again with resettable properties, property behaviors, or one of the other similarly proposed ideas on swift-evolution.\r\n\r\nThere's still some cleanup to be done here—the decoder can be simplified now that we're not using the full set of methods, but this change started getting unwieldy enough and that kind of cleanup can be done after the fact.\r\n\r\nThe commits in this PR have been broken up by file directory to make them easier to scan through. They will not build independently and will be squashed before merging.\r\n\r\nFixes #24.","created_at":"2016-10-17T15:46:50Z","updated_at":"2016-10-18T17:55:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f683a9600def0484dd5cd6a7561099d7a7f74257","assignee":{"login":"tbkka","id":21696764,"avatar_url":"https://avatars.githubusercontent.com/u/21696764?v=3","gravatar_id":"","url":"https://api.github.com/users/tbkka","html_url":"https://github.com/tbkka","followers_url":"https://api.github.com/users/tbkka/followers","following_url":"https://api.github.com/users/tbkka/following{/other_user}","gists_url":"https://api.github.com/users/tbkka/gists{/gist_id}","starred_url":"https://api.github.com/users/tbkka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbkka/subscriptions","organizations_url":"https://api.github.com/users/tbkka/orgs","repos_url":"https://api.github.com/users/tbkka/repos","events_url":"https://api.github.com/users/tbkka/events{/privacy}","received_events_url":"https://api.github.com/users/tbkka/received_events","type":"User","site_admin":false},"assignees":[{"login":"tbkka","id":21696764,"avatar_url":"https://avatars.githubusercontent.com/u/21696764?v=3","gravatar_id":"","url":"https://api.github.com/users/tbkka","html_url":"https://github.com/tbkka","followers_url":"https://api.github.com/users/tbkka/followers","following_url":"https://api.github.com/users/tbkka/following{/other_user}","gists_url":"https://api.github.com/users/tbkka/gists{/gist_id}","starred_url":"https://api.github.com/users/tbkka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbkka/subscriptions","organizations_url":"https://api.github.com/users/tbkka/orgs","repos_url":"https://api.github.com/users/tbkka/repos","events_url":"https://api.github.com/users/tbkka/events{/privacy}","received_events_url":"https://api.github.com/users/tbkka/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/apple/swift-protobuf/pulls/102/commits","review_comments_url":"https://api.github.com/repos/apple/swift-protobuf/pulls/102/comments","review_comment_url":"https://api.github.com/repos/apple/swift-protobuf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/swift-protobuf/issues/102/comments","statuses_url":"https://api.github.com/repos/apple/swift-protobuf/statuses/e1fe78ff99cc5deac45f6117b6e3efc4919f4f51","head":{"label":"allevato:has-properties-clean","ref":"has-properties-clean","sha":"e1fe78ff99cc5deac45f6117b6e3efc4919f4f51","user":{"login":"allevato","id":1062427,"avatar_url":"https://avatars.githubusercontent.com/u/1062427?v=3","gravatar_id":"","url":"https://api.github.com/users/allevato","html_url":"https://github.com/allevato","followers_url":"https://api.github.com/users/allevato/followers","following_url":"https://api.github.com/users/allevato/following{/other_user}","gists_url":"https://api.github.com/users/allevato/gists{/gist_id}","starred_url":"https://api.github.com/users/allevato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allevato/subscriptions","organizations_url":"https://api.github.com/users/allevato/orgs","repos_url":"https://api.github.com/users/allevato/repos","events_url":"https://api.github.com/users/allevato/events{/privacy}","received_events_url":"https://api.github.com/users/allevato/received_events","type":"User","site_admin":false},"repo":{"id":69577052,"name":"swift-protobuf","full_name":"allevato/swift-protobuf","owner":{"login":"allevato","id":1062427,"avatar_url":"https://avatars.githubusercontent.com/u/1062427?v=3","gravatar_id":"","url":"https://api.github.com/users/allevato","html_url":"https://github.com/allevato","followers_url":"https://api.github.com/users/allevato/followers","following_url":"https://api.github.com/users/allevato/following{/other_user}","gists_url":"https://api.github.com/users/allevato/gists{/gist_id}","starred_url":"https://api.github.com/users/allevato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allevato/subscriptions","organizations_url":"https://api.github.com/users/allevato/orgs","repos_url":"https://api.github.com/users/allevato/repos","events_url":"https://api.github.com/users/allevato/events{/privacy}","received_events_url":"https://api.github.com/users/allevato/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/allevato/swift-protobuf","description":"Runtime library needed to use code generated by swift-protobuf-plugin","fork":true,"url":"https://api.github.com/repos/allevato/swift-protobuf","forks_url":"https://api.github.com/repos/allevato/swift-protobuf/forks","keys_url":"https://api.github.com/repos/allevato/swift-protobuf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allevato/swift-protobuf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allevato/swift-protobuf/teams","hooks_url":"https://api.github.com/repos/allevato/swift-protobuf/hooks","issue_events_url":"https://api.github.com/repos/allevato/swift-protobuf/issues/events{/number}","events_url":"https://api.github.com/repos/allevato/swift-protobuf/events","assignees_url":"https://api.github.com/repos/allevato/swift-protobuf/assignees{/user}","branches_url":"https://api.github.com/repos/allevato/swift-protobuf/branches{/branch}","tags_url":"https://api.github.com/repos/allevato/swift-protobuf/tags","blobs_url":"https://api.github.com/repos/allevato/swift-protobuf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allevato/swift-protobuf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allevato/swift-protobuf/git/refs{/sha}","trees_url":"https://api.github.com/repos/allevato/swift-protobuf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allevato/swift-protobuf/statuses/{sha}","languages_url":"https://api.github.com/repos/allevato/swift-protobuf/languages","stargazers_url":"https://api.github.com/repos/allevato/swift-protobuf/stargazers","contributors_url":"https://api.github.com/repos/allevato/swift-protobuf/contributors","subscribers_url":"https://api.github.com/repos/allevato/swift-protobuf/subscribers","subscription_url":"https://api.github.com/repos/allevato/swift-protobuf/subscription","commits_url":"https://api.github.com/repos/allevato/swift-protobuf/commits{/sha}","git_commits_url":"https://api.github.com/repos/allevato/swift-protobuf/git/commits{/sha}","comments_url":"https://api.github.com/repos/allevato/swift-protobuf/comments{/number}","issue_comment_url":"https://api.github.com/repos/allevato/swift-protobuf/issues/comments{/number}","contents_url":"https://api.github.com/repos/allevato/swift-protobuf/contents/{+path}","compare_url":"https://api.github.com/repos/allevato/swift-protobuf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allevato/swift-protobuf/merges","archive_url":"https://api.github.com/repos/allevato/swift-protobuf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allevato/swift-protobuf/downloads","issues_url":"https://api.github.com/repos/allevato/swift-protobuf/issues{/number}","pulls_url":"https://api.github.com/repos/allevato/swift-protobuf/pulls{/number}","milestones_url":"https://api.github.com/repos/allevato/swift-protobuf/milestones{/number}","notifications_url":"https://api.github.com/repos/allevato/swift-protobuf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allevato/swift-protobuf/labels{/name}","releases_url":"https://api.github.com/repos/allevato/swift-protobuf/releases{/id}","deployments_url":"https://api.github.com/repos/allevato/swift-protobuf/deployments","created_at":"2016-09-29T14:45:08Z","updated_at":"2016-09-29T18:52:06Z","pushed_at":"2016-10-17T15:39:31Z","git_url":"git://github.com/allevato/swift-protobuf.git","ssh_url":"git@github.com:allevato/swift-protobuf.git","clone_url":"https://github.com/allevato/swift-protobuf.git","svn_url":"https://github.com/allevato/swift-protobuf","homepage":"","size":1653,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apple:master","ref":"master","sha":"8f809f9252c6d12cc341b9602a5cb51b3bd2e535","user":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"repo":{"id":67177488,"name":"swift-protobuf","full_name":"apple/swift-protobuf","owner":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apple/swift-protobuf","description":"Plugin and runtime library for using protobuf with Swift","fork":false,"url":"https://api.github.com/repos/apple/swift-protobuf","forks_url":"https://api.github.com/repos/apple/swift-protobuf/forks","keys_url":"https://api.github.com/repos/apple/swift-protobuf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift-protobuf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift-protobuf/teams","hooks_url":"https://api.github.com/repos/apple/swift-protobuf/hooks","issue_events_url":"https://api.github.com/repos/apple/swift-protobuf/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift-protobuf/events","assignees_url":"https://api.github.com/repos/apple/swift-protobuf/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift-protobuf/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift-protobuf/tags","blobs_url":"https://api.github.com/repos/apple/swift-protobuf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift-protobuf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift-protobuf/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift-protobuf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift-protobuf/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift-protobuf/languages","stargazers_url":"https://api.github.com/repos/apple/swift-protobuf/stargazers","contributors_url":"https://api.github.com/repos/apple/swift-protobuf/contributors","subscribers_url":"https://api.github.com/repos/apple/swift-protobuf/subscribers","subscription_url":"https://api.github.com/repos/apple/swift-protobuf/subscription","commits_url":"https://api.github.com/repos/apple/swift-protobuf/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift-protobuf/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift-protobuf/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift-protobuf/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift-protobuf/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift-protobuf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift-protobuf/merges","archive_url":"https://api.github.com/repos/apple/swift-protobuf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift-protobuf/downloads","issues_url":"https://api.github.com/repos/apple/swift-protobuf/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift-protobuf/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift-protobuf/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift-protobuf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift-protobuf/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift-protobuf/releases{/id}","deployments_url":"https://api.github.com/repos/apple/swift-protobuf/deployments","created_at":"2016-09-02T00:51:55Z","updated_at":"2016-10-18T16:58:30Z","pushed_at":"2016-10-18T16:19:06Z","git_url":"git://github.com/apple/swift-protobuf.git","ssh_url":"git@github.com:apple/swift-protobuf.git","clone_url":"https://github.com/apple/swift-protobuf.git","svn_url":"https://github.com/apple/swift-protobuf","homepage":"","size":1839,"stargazers_count":415,"watchers_count":415,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":31,"forks":24,"open_issues":31,"watchers":415,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/swift-protobuf/pulls/102"},"html":{"href":"https://github.com/apple/swift-protobuf/pull/102"},"issue":{"href":"https://api.github.com/repos/apple/swift-protobuf/issues/102"},"comments":{"href":"https://api.github.com/repos/apple/swift-protobuf/issues/102/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/swift-protobuf/pulls/102/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/swift-protobuf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/swift-protobuf/pulls/102/commits"},"statuses":{"href":"https://api.github.com/repos/apple/swift-protobuf/statuses/e1fe78ff99cc5deac45f6117b6e3efc4919f4f51"}}}}
{"actor":{"display_login":"allevato"}}