{"action":"created","issue":{"url":"https://api.github.com/repos/gogo/protobuf/issues/36","labels_url":"https://api.github.com/repos/gogo/protobuf/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/gogo/protobuf/issues/36/comments","events_url":"https://api.github.com/repos/gogo/protobuf/issues/36/events","html_url":"https://github.com/gogo/protobuf/issues/36","id":52612251,"number":36,"title":"customtype for uint32 breaks unmarshaler build with mismatched types across |=","user":{"login":"tv42","id":419909,"avatar_url":"https://avatars.githubusercontent.com/u/419909?v=3","gravatar_id":"","url":"https://api.github.com/users/tv42","html_url":"https://github.com/tv42","followers_url":"https://api.github.com/users/tv42/followers","following_url":"https://api.github.com/users/tv42/following{/other_user}","gists_url":"https://api.github.com/users/tv42/gists{/gist_id}","starred_url":"https://api.github.com/users/tv42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tv42/subscriptions","organizations_url":"https://api.github.com/users/tv42/orgs","repos_url":"https://api.github.com/users/tv42/repos","events_url":"https://api.github.com/users/tv42/events{/privacy}","received_events_url":"https://api.github.com/users/tv42/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2014-12-22T01:10:11Z","updated_at":"2015-04-16T15:28:05Z","closed_at":null,"body":"main.go:\r\n```go\r\npackage main\r\n\r\n//go:generate protoc -I. -I$GOPATH/src -I$GOPATH/src/github.com/gogo/protobuf/protobuf --gogo_out=. repro.proto\r\n\r\ntype T uint32\r\n\r\nfunc main() {\r\n}\r\n```\r\n\r\nrepro.proto:\r\n```protobuf\r\npackage repro;\r\n\r\noption go_package = \"main\";\r\n\r\nimport \"github.com/gogo/protobuf/gogoproto/gogo.proto\";\r\n\r\noption (gogoproto.unmarshaler_all) = true;\r\n\r\nmessage M {\r\n  required uint32 X = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = \"T\"];\r\n}\r\n```\r\n\r\n```console\r\n$ go generate && go build\r\n# _/home/tv/src/2014/protobuf-bug-type\r\n./repro.pb.go:69: invalid operation: m.X |= uint32(b) & 127 << shift (mismatched types T and uint32)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/gogo/protobuf/issues/comments/93763656","html_url":"https://github.com/gogo/protobuf/issues/36#issuecomment-93763656","issue_url":"https://api.github.com/repos/gogo/protobuf/issues/36","id":93763656,"user":{"login":"bdarnell","id":160562,"avatar_url":"https://avatars.githubusercontent.com/u/160562?v=3","gravatar_id":"","url":"https://api.github.com/users/bdarnell","html_url":"https://github.com/bdarnell","followers_url":"https://api.github.com/users/bdarnell/followers","following_url":"https://api.github.com/users/bdarnell/following{/other_user}","gists_url":"https://api.github.com/users/bdarnell/gists{/gist_id}","starred_url":"https://api.github.com/users/bdarnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdarnell/subscriptions","organizations_url":"https://api.github.com/users/bdarnell/orgs","repos_url":"https://api.github.com/users/bdarnell/repos","events_url":"https://api.github.com/users/bdarnell/events{/privacy}","received_events_url":"https://api.github.com/users/bdarnell/received_events","type":"User","site_admin":false},"created_at":"2015-04-16T15:28:05Z","updated_at":"2015-04-16T15:28:05Z","body":"Types and names must both match, so the more cumbersome `type NodeID struct { NodeID int64 }` would work to prevent casting: http://play.golang.org/p/e39xF_NTup"}}