{"action":"created","issue":{"url":"https://api.github.com/repos/google/flatbuffers/issues/3914","repository_url":"https://api.github.com/repos/google/flatbuffers","labels_url":"https://api.github.com/repos/google/flatbuffers/issues/3914/labels{/name}","comments_url":"https://api.github.com/repos/google/flatbuffers/issues/3914/comments","events_url":"https://api.github.com/repos/google/flatbuffers/issues/3914/events","html_url":"https://github.com/google/flatbuffers/issues/3914","id":161450683,"number":3914,"title":"Union type as enum in C#","user":{"login":"johngalt131","id":1595971,"avatar_url":"https://avatars.githubusercontent.com/u/1595971?v=3","gravatar_id":"","url":"https://api.github.com/users/johngalt131","html_url":"https://github.com/johngalt131","followers_url":"https://api.github.com/users/johngalt131/followers","following_url":"https://api.github.com/users/johngalt131/following{/other_user}","gists_url":"https://api.github.com/users/johngalt131/gists{/gist_id}","starred_url":"https://api.github.com/users/johngalt131/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johngalt131/subscriptions","organizations_url":"https://api.github.com/users/johngalt131/orgs","repos_url":"https://api.github.com/users/johngalt131/repos","events_url":"https://api.github.com/users/johngalt131/events{/privacy}","received_events_url":"https://api.github.com/users/johngalt131/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-06-21T14:24:16Z","updated_at":"2016-06-22T18:01:33Z","closed_at":null,"body":"Is it possible to force the underlying enum type to something larger than byte in C#? This works fine in C++. I have a Union with close to 500 tables.\r\n\r\n`union DataType {\r\n   EVNT_ALL_CREATE_OBJECT_T,\r\n   EVNT_ALL_DETONATION_T,\r\n...\r\n}`\r\n\r\ncompiles to \r\n\r\n`public enum DataType : byte\r\n{\r\n NONE = 0,\r\n EVNT_ALL_CREATE_OBJECT_T = 1,\r\n EVNT_ALL_DETONATION_T = 2,\r\n...\r\n}`\r\n\r\n\r\nI've tried \r\n\r\n`union DataType : short {\r\n   EVNT_ALL_CREATE_OBJECT_T,\r\n   EVNT_ALL_DETONATION_T,\r\n...\r\n}`\r\n\r\nbut I get a flatc.exe error.\r\n\r\n\r\nIf there's another way of easily emulating a Union's functionality with this many tables, that would be acceptable as well."},"comment":{"url":"https://api.github.com/repos/google/flatbuffers/issues/comments/227826904","html_url":"https://github.com/google/flatbuffers/issues/3914#issuecomment-227826904","issue_url":"https://api.github.com/repos/google/flatbuffers/issues/3914","id":227826904,"user":{"login":"gwvo","id":6145400,"avatar_url":"https://avatars.githubusercontent.com/u/6145400?v=3","gravatar_id":"","url":"https://api.github.com/users/gwvo","html_url":"https://github.com/gwvo","followers_url":"https://api.github.com/users/gwvo/followers","following_url":"https://api.github.com/users/gwvo/following{/other_user}","gists_url":"https://api.github.com/users/gwvo/gists{/gist_id}","starred_url":"https://api.github.com/users/gwvo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwvo/subscriptions","organizations_url":"https://api.github.com/users/gwvo/orgs","repos_url":"https://api.github.com/users/gwvo/repos","events_url":"https://api.github.com/users/gwvo/events{/privacy}","received_events_url":"https://api.github.com/users/gwvo/received_events","type":"User","site_admin":false},"created_at":"2016-06-22T18:01:33Z","updated_at":"2016-06-22T18:01:33Z","body":"Hmm.. I am ashamed to say the union type is hard-coded to be a byte in all implementations (see idl.h line 39). Somehow in my infinite wisdom I never expected anyone to have that big a union.\r\n\r\nChanging this seems to me would be incompatible at an encoding level, so is not easy to fix.\r\n\r\n@Lakedaemon : how do you propose this to be fixed? What did you do in Kotlin?\r\n\r\nI'll look at your PR :)"}}
{"actor":{"display_login":"gwvo"}}