{"action":"created","issue":{"url":"https://api.github.com/repos/gogo/protobuf/issues/204","repository_url":"https://api.github.com/repos/gogo/protobuf","labels_url":"https://api.github.com/repos/gogo/protobuf/issues/204/labels{/name}","comments_url":"https://api.github.com/repos/gogo/protobuf/issues/204/comments","events_url":"https://api.github.com/repos/gogo/protobuf/issues/204/events","html_url":"https://github.com/gogo/protobuf/issues/204","id":179130497,"number":204,"title":"bool extension fields result in invalid generated code","user":{"login":"alecthomas","id":41767,"avatar_url":"https://avatars.githubusercontent.com/u/41767?v=3","gravatar_id":"","url":"https://api.github.com/users/alecthomas","html_url":"https://github.com/alecthomas","followers_url":"https://api.github.com/users/alecthomas/followers","following_url":"https://api.github.com/users/alecthomas/following{/other_user}","gists_url":"https://api.github.com/users/alecthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/alecthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alecthomas/subscriptions","organizations_url":"https://api.github.com/users/alecthomas/orgs","repos_url":"https://api.github.com/users/alecthomas/repos","events_url":"https://api.github.com/users/alecthomas/events{/privacy}","received_events_url":"https://api.github.com/users/alecthomas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-26T03:09:32Z","updated_at":"2016-09-26T06:41:45Z","closed_at":null,"body":"I couldn't see any existing issues for this, so here it is.\r\n\r\nThis:\r\n\r\n```proto\r\nextend google.protobuf.FieldOptions {\r\n  bool primary = 51234;\r\n  bool index = 51235;\r\n}\r\n```\r\n\r\nResults in this:\r\n\r\n```go\r\nvar E_Primary = &proto.ExtensionDesc{\r\n  ExtendedType:  (*google_protobuf.FieldOptions)(nil),\r\n  ExtensionType: (bool)(nil),\r\n  Field:         51234,\r\n  Name:          \"store.primary\",\r\n  Tag:           \"varint,51234,opt,name=primary\",\r\n}\r\n\r\nvar E_Index = &proto.ExtensionDesc{\r\n  ExtendedType:  (*google_protobuf.FieldOptions)(nil),\r\n  ExtensionType: (bool)(nil),\r\n  Field:         51235,\r\n  Name:          \"store.index\",\r\n  Tag:           \"varint,51235,opt,name=index\",\r\n}\r\n```\r\n\r\nWhich fails to compile because bool can not be cast to nil:\r\n\r\n```\r\nstore.pb.go:58: cannot convert nil to type bool\r\nstore.pb.go:66: cannot convert nil to type bool\r\n```"},"comment":{"url":"https://api.github.com/repos/gogo/protobuf/issues/comments/249490922","html_url":"https://github.com/gogo/protobuf/issues/204#issuecomment-249490922","issue_url":"https://api.github.com/repos/gogo/protobuf/issues/204","id":249490922,"user":{"login":"alecthomas","id":41767,"avatar_url":"https://avatars.githubusercontent.com/u/41767?v=3","gravatar_id":"","url":"https://api.github.com/users/alecthomas","html_url":"https://github.com/alecthomas","followers_url":"https://api.github.com/users/alecthomas/followers","following_url":"https://api.github.com/users/alecthomas/following{/other_user}","gists_url":"https://api.github.com/users/alecthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/alecthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alecthomas/subscriptions","organizations_url":"https://api.github.com/users/alecthomas/orgs","repos_url":"https://api.github.com/users/alecthomas/repos","events_url":"https://api.github.com/users/alecthomas/events{/privacy}","received_events_url":"https://api.github.com/users/alecthomas/received_events","type":"User","site_admin":false},"created_at":"2016-09-26T06:41:45Z","updated_at":"2016-09-26T06:41:45Z","body":"This was with proto3. I will send through reproducible samples in a bit. The standard proto compiler works. It was compiled with the one that generates .Equals()"}}
{"actor":{"display_login":"alecthomas"}}