payload: {"action":"opened","issue":{"url":"https://api.github.com/repos/dotnet/roslyn-analyzers/issues/2977","repository_url":"https://api.github.com/repos/dotnet/roslyn-analyzers","labels_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/issues/2977/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/issues/2977/comments","events_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/issues/2977/events","html_url":"https://github.com/dotnet/roslyn-analyzers/issues/2977","id":512373891,"node_id":"MDU6SXNzdWU1MTIzNzM4OTE=","number":2977,"title":"Call System.IDisposable.Dispose False Positive Warning","user":{"login":"supertx2","id":13727650,"node_id":"MDQ6VXNlcjEzNzI3NjUw","avatar_url":"https://avatars1.githubusercontent.com/u/13727650?v=4","gravatar_id":"","url":"https://api.github.com/users/supertx2","html_url":"https://github.com/supertx2","followers_url":"https://api.github.com/users/supertx2/followers","following_url":"https://api.github.com/users/supertx2/following{/other_user}","gists_url":"https://api.github.com/users/supertx2/gists{/gist_id}","starred_url":"https://api.github.com/users/supertx2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supertx2/subscriptions","organizations_url":"https://api.github.com/users/supertx2/orgs","repos_url":"https://api.github.com/users/supertx2/repos","events_url":"https://api.github.com/users/supertx2/events{/privacy}","received_events_url":"https://api.github.com/users/supertx2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-10-25T08:21:59Z","updated_at":"2019-10-25T08:21:59Z","closed_at":null,"author_association":"NONE","body":"#### Analyzer package\r\n\r\n[Microsoft.CodeAnalysis.FxCopAnalyzers](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers)\r\n\r\n#### Package Version\r\n\r\nv2.9.5 (Latest)\r\n\r\n#### Diagnostic ID\r\n\r\nExample: [CA1716](https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1716-identifiers-should-not-match-keywords)\r\n\r\n#### Repro steps\r\n\r\n`\r\nprivate async Task TestConnection()\r\n{\r\n            SqlCommand cmd = new SqlCommand(\"My_Proc\", new SqlConnection());\r\n            cmd.CommandType = CommandType.StoredProcedure;\r\n\r\n            await cmd.ExecuteNonQueryAsync().ContinueWith((_) => cmd.Dispose()).ConfigureAwait(false);\r\n}\r\n`\r\n#### Expected behavior\r\nThe SqlCommand is being dispose after the task is complete so no warning should be raised\r\n#### Actual behavior\r\nA Warning is being generated :\r\nWarning\tCA2000\tCall System.IDisposable.Dispose on object created by 'new SqlCommand(\"My_Proc\", new SqlConnection())' before all references to it are out of scope.\r\n"}}
other: {"actor":{"display_login":"supertx2"}}