{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/19278","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/19278/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/19278/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/19278/events","html_url":"https://github.com/dotnet/roslyn/pull/19278","id":226429579,"number":19278,"title":"IObjectCreationExpression API Change","user":{"login":"mavasani","id":10605811,"avatar_url":"https://avatars1.githubusercontent.com/u/10605811?v=3","gravatar_id":"","url":"https://api.github.com/users/mavasani","html_url":"https://github.com/mavasani","followers_url":"https://api.github.com/users/mavasani/followers","following_url":"https://api.github.com/users/mavasani/following{/other_user}","gists_url":"https://api.github.com/users/mavasani/gists{/gist_id}","starred_url":"https://api.github.com/users/mavasani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mavasani/subscriptions","organizations_url":"https://api.github.com/users/mavasani/orgs","repos_url":"https://api.github.com/users/mavasani/repos","events_url":"https://api.github.com/users/mavasani/events{/privacy}","received_events_url":"https://api.github.com/users/mavasani/received_events","type":"User","site_admin":false},"labels":[{"id":197452922,"url":"https://api.github.com/repos/dotnet/roslyn/labels/cla-already-signed","name":"cla-already-signed","color":"FFFFFF","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-05-04T22:46:41Z","updated_at":"2017-05-05T15:18:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/19278","html_url":"https://github.com/dotnet/roslyn/pull/19278","diff_url":"https://github.com/dotnet/roslyn/pull/19278.diff","patch_url":"https://github.com/dotnet/roslyn/pull/19278.patch"},"body":"**Customer scenario**\r\n\r\nAll IOperation based analyzers will generate large number of false positives OR not analyze code within object and collection initializers. Given that such a code pattern is very common, this can be a dogfood blocker for IOperation analyzers (FXCop). \r\n\r\n**Bugs this fixes:**\r\n\r\nFixes #18115\r\n\r\nThere are still 2 remaining bugs affecting this area:\r\n1. #18781: IOperation API shape for collection initializer expressions\r\n2. #19276: Missing Field/Property reference expression nodes in object creation initializer node\r\n\r\n**Workarounds, if any**\r\n\r\nThe analyzer users will have to either suppress all IOperation analyzers on methods containing object/collection initializers or disable these analyzers.\r\n\r\n**Risk**\r\n\r\nLow. We are just returning the operation nodes as they are in the bound tree rather than synthesizing new symbol initializer nodes.\r\n\r\n**Performance impact**\r\n\r\nNone\r\n\r\n**Is this a regression from a previous update?**\r\n\r\nNo, this was the original IOperation API implementation\r\n\r\n**Root cause analysis:**\r\n\r\nThe underlying reason is that the current API shape of IObjectCreationExpression only exposes member initializers, not collection initializers.\r\n\r\nThere are couple of changes in this PR:\r\n1. API change: `ImmutableArray<ISymbolInitializer> MemberInitializers` is changed to `ImmutableArray<IOperation> Initializers` as per design time decision.\r\n2. Implementation changes:\r\n   1. Instead of returning the member initializers as synthesized ISymbolInitializer nodes, we now return member initializers as IAssignmentExpression nodes. This ensures completeness of IOperation tree.\r\n   2. Now we also return the collection initializer expressions within an object creation expression.\r\n\r\n**How was the bug found?**\r\n\r\nDogfooding.\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/299493551","html_url":"https://github.com/dotnet/roslyn/pull/19278#issuecomment-299493551","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/19278","id":299493551,"user":{"login":"cston","id":10732005,"avatar_url":"https://avatars1.githubusercontent.com/u/10732005?v=3","gravatar_id":"","url":"https://api.github.com/users/cston","html_url":"https://github.com/cston","followers_url":"https://api.github.com/users/cston/followers","following_url":"https://api.github.com/users/cston/following{/other_user}","gists_url":"https://api.github.com/users/cston/gists{/gist_id}","starred_url":"https://api.github.com/users/cston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cston/subscriptions","organizations_url":"https://api.github.com/users/cston/orgs","repos_url":"https://api.github.com/users/cston/repos","events_url":"https://api.github.com/users/cston/events{/privacy}","received_events_url":"https://api.github.com/users/cston/received_events","type":"User","site_admin":false},"created_at":"2017-05-05T15:18:50Z","updated_at":"2017-05-05T15:18:50Z","body":"LGTM"}}
{"actor":{"display_login":"cston"}}