{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/bond/issues/123","labels_url":"https://api.github.com/repos/Microsoft/bond/issues/123/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/bond/issues/123/comments","events_url":"https://api.github.com/repos/Microsoft/bond/issues/123/events","html_url":"https://github.com/Microsoft/bond/issues/123","id":127540300,"number":123,"title":"Field names should be rejected if they duplicate another field name","user":{"login":"chwarr","id":10605667,"avatar_url":"https://avatars.githubusercontent.com/u/10605667?v=3","gravatar_id":"","url":"https://api.github.com/users/chwarr","html_url":"https://github.com/chwarr","followers_url":"https://api.github.com/users/chwarr/followers","following_url":"https://api.github.com/users/chwarr/following{/other_user}","gists_url":"https://api.github.com/users/chwarr/gists{/gist_id}","starred_url":"https://api.github.com/users/chwarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chwarr/subscriptions","organizations_url":"https://api.github.com/users/chwarr/orgs","repos_url":"https://api.github.com/users/chwarr/repos","events_url":"https://api.github.com/users/chwarr/events{/privacy}","received_events_url":"https://api.github.com/users/chwarr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/bond/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-19T21:15:26Z","updated_at":"2016-01-19T21:15:26Z","closed_at":null,"body":"The following .bond file should fail `gbc` code generation, as it contains two fields with the same name.\r\n\r\n```\r\nnamespace duplicate_field_names;\r\n\r\nstruct ShouldBeRejected\r\n{\r\n    0: bool DuplicateFieldName;\r\n    1: bool DuplicateFieldName;\r\n}\r\n```\r\n\r\nHowever, Bond Compiler 0.4.0.1 accepts this .bond file and generates C++ and C# code that does not compile.\r\n\r\nHere's an excerpt of the generated C# code.\r\n\r\n```\r\nnamespace duplicate_field_names\r\n{\r\n    using System.Collections.Generic;\r\n\r\n    [global::Bond.Schema]\r\n    [System.CodeDom.Compiler.GeneratedCode(\"gbc\", \"0.4.0.1\")]\r\n    public partial class ShouldBeRejected\r\n    {\r\n        [global::Bond.Id(0)]\r\n        public bool DuplicateFieldName { get; set; }\r\n\r\n        [global::Bond.Id(1)]\r\n        public bool DuplicateFieldName { get; set; }\r\n\r\n        public ShouldBeRejected()\r\n            : this(\"duplicate_field_names.ShouldBeRejected\", \"ShouldBeRejected\")\r\n        {}\r\n\r\n        protected ShouldBeRejected(string fullName, string name)\r\n        {\r\n\r\n        }\r\n    }\r\n} // duplicate_field_names\r\n```"}}