{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/4581","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/4581/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/4581/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/4581/events","html_url":"https://github.com/dotnet/roslyn/issues/4581","id":101227657,"number":4581,"title":"Invalid initializer member declarator","user":{"login":"biqas","id":5908247,"avatar_url":"https://avatars.githubusercontent.com/u/5908247?v=3","gravatar_id":"","url":"https://api.github.com/users/biqas","html_url":"https://github.com/biqas","followers_url":"https://api.github.com/users/biqas/followers","following_url":"https://api.github.com/users/biqas/following{/other_user}","gists_url":"https://api.github.com/users/biqas/gists{/gist_id}","starred_url":"https://api.github.com/users/biqas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biqas/subscriptions","organizations_url":"https://api.github.com/users/biqas/orgs","repos_url":"https://api.github.com/users/biqas/repos","events_url":"https://api.github.com/users/biqas/events{/privacy}","received_events_url":"https://api.github.com/users/biqas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Language%20Design","name":"Area-Language Design","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Question","name":"Question","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-08-16T02:52:01Z","updated_at":"2015-08-23T13:27:47Z","closed_at":"2015-08-23T13:27:47Z","body":"I'm not quite sure if this was a valid syntax in the previous compiler, but I think I had used this syntax already in the past.\r\n\r\nThe question is if it was even in the previous compiler not allowed, why?\r\nIn the current Visual Studio 2015 compiler it is not valid!\r\n\r\n```csharp\r\npublic class Program\r\n{\r\n    public void Main(string[] args)\r\n    {\r\n        var collection = new MyCollection\r\n        {\r\n            MyProperty = \"42\",\r\n\r\n            / / does not compile!!! (\"Invalid initializer member declarator\")\r\n            new MyItem\r\n            {\r\n                MyProperty = 42\r\n            }\r\n        };\r\n    }\r\n}\r\n\r\npublic class MyCollection\r\n    : IEnumerable<MyItem>\r\n{\r\n    public String MyProperty { get; set; }\r\n\r\n    public void Add(MyItem @myItem)\r\n    {\r\n    }\r\n\r\n    IEnumerator IEnumerable.GetEnumerator()\r\n    {\r\n        throw new NotImplementedException();\r\n    }\r\n\r\n    IEnumerator<MyItem> IEnumerable<MyItem>.GetEnumerator()\r\n    {\r\n        throw new NotImplementedException();\r\n    }\r\n}\r\n\r\npublic class MyItem\r\n{\r\n    public int MyProperty { get; set; }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/133832645","html_url":"https://github.com/dotnet/roslyn/issues/4581#issuecomment-133832645","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/4581","id":133832645,"user":{"login":"biqas","id":5908247,"avatar_url":"https://avatars.githubusercontent.com/u/5908247?v=3","gravatar_id":"","url":"https://api.github.com/users/biqas","html_url":"https://github.com/biqas","followers_url":"https://api.github.com/users/biqas/followers","following_url":"https://api.github.com/users/biqas/following{/other_user}","gists_url":"https://api.github.com/users/biqas/gists{/gist_id}","starred_url":"https://api.github.com/users/biqas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biqas/subscriptions","organizations_url":"https://api.github.com/users/biqas/orgs","repos_url":"https://api.github.com/users/biqas/repos","events_url":"https://api.github.com/users/biqas/events{/privacy}","received_events_url":"https://api.github.com/users/biqas/received_events","type":"User","site_admin":false},"created_at":"2015-08-23T13:27:47Z","updated_at":"2015-08-23T13:27:47Z","body":"@svick \r\nAfter considering lot of code what I have written in the past and how the language (C#) is designed I'm now also convinced that mixing both (object-initializer and collection-initializer) wouldn't be a good idea."}}