{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/232106452","pull_request_review_id":173229866,"id":232106452,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjEwNjQ1Mg==","diff_hunk":"@@ -40,8 +40,47 @@ public static ValueUsageInfo GetValueUsageInfo(this IOperation operation)\n             | nameof(x)       |      |       |             |             |       ✔️        | ️\n             | sizeof(x)       |      |       |             |             |       ✔️        | ️\n             | typeof(x)       |      |       |             |             |       ✔️        | ️\n+            | out var x       |      |  ✔️   |             |             |                 | ️\n+            | case X x:       |      |  ✔️   |             |             |                 | ️\n+            | obj is X x      |  ✔️  |  ✔️   |             |             |                 |\n \n             */\n+            if (operation is ILocalReferenceOperation localReference &&\n+                localReference.IsDeclaration &&\n+                !localReference.IsImplicit) // Workaround for https://github.com/dotnet/roslyn/issues/30753\n+            {\n+                // Declaration expression is a definition (write) for the declared local.\n+                return ValueUsageInfo.Write;\n+            }\n+            else if (operation is IDeclarationPatternOperation)\n+            {\n+                switch (operation.Parent)\n+                {\n+                    case IPatternCaseClauseOperation _:\n+                        // A declaration pattern within a pattern case clause is a\n+                        // write for the declared local.\n+                        // For example, 'x' is defined and assigned the value from 'obj' below:\n+                        //      switch (obj)\n+                        //      {\n+                        //          case X x:\n+                        //\n+                        return ValueUsageInfo.Write;\n+\n+                    case IIsPatternOperation _:\n+                        // A declaration pattern within an is pattern is a\n+                        // both a write and read for the declared local.\n+                        // For example, 'x' is both written and read in the following expression:\n+                        //      if (obj is X x)\n+                        //\n+                        return ValueUsageInfo.ReadWrite;","path":"src/Workspaces/Core/Portable/Extensions/OperationExtensions.cs","position":36,"original_position":36,"commit_id":"3d072d5029b0caa5b64a6474366a3156760b722b","original_commit_id":"3d072d5029b0caa5b64a6474366a3156760b722b","user":{"login":"CyrusNajmabadi","id":4564579,"node_id":"MDQ6VXNlcjQ1NjQ1Nzk=","avatar_url":"https://avatars3.githubusercontent.com/u/4564579?v=4","gravatar_id":"","url":"https://api.github.com/users/CyrusNajmabadi","html_url":"https://github.com/CyrusNajmabadi","followers_url":"https://api.github.com/users/CyrusNajmabadi/followers","following_url":"https://api.github.com/users/CyrusNajmabadi/following{/other_user}","gists_url":"https://api.github.com/users/CyrusNajmabadi/gists{/gist_id}","starred_url":"https://api.github.com/users/CyrusNajmabadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CyrusNajmabadi/subscriptions","organizations_url":"https://api.github.com/users/CyrusNajmabadi/orgs","repos_url":"https://api.github.com/users/CyrusNajmabadi/repos","events_url":"https://api.github.com/users/CyrusNajmabadi/events{/privacy}","received_events_url":"https://api.github.com/users/CyrusNajmabadi/received_events","type":"User","site_admin":false},"body":"Oh interesting!  so `is var x` isn't even a pattern in the IOp world?  ","created_at":"2018-11-09T00:13:56Z","updated_at":"2018-11-09T00:13:56Z","html_url":"https://github.com/dotnet/roslyn/pull/31025#discussion_r232106452","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/31025","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/232106452"},"html":{"href":"https://github.com/dotnet/roslyn/pull/31025#discussion_r232106452"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/31025"}},"in_reply_to_id":231664635},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/31025","id":229153334,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5MTUzMzM0","html_url":"https://github.com/dotnet/roslyn/pull/31025","diff_url":"https://github.com/dotnet/roslyn/pull/31025.diff","patch_url":"https://github.com/dotnet/roslyn/pull/31025.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/31025","number":31025,"state":"open","locked":false,"title":"Add CFG based dataflow analysis framework to the Workspaces layer","user":{"login":"mavasani","id":10605811,"node_id":"MDQ6VXNlcjEwNjA1ODEx","avatar_url":"https://avatars2.githubusercontent.com/u/10605811?v=4","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},"body":"This PR extracts out the flow-analysis component from #30777 for easier code review.\r\n\r\nSupport added in this PR:\r\n1. Core dataflow walker to walk the control flow graph and compute/track custom analysis data (CustomDataFlowAnalysis).\r\n2. Internal API (DataFlowAnalyzer) to implement custom dataflow analysis on top of the above walker.\r\n3. Implementation of a SymbolUsageAnalysis dataflow analyzer to compute read/write usages for local and parameter symbols\r\n4. Implementation of a test-only BasicBlockReachabilityDataFlowAnalyzer to compute and validate basic block reachability on all CFGs generated in compiler's flow analysis unit tests.\r\n\r\nPlease refer to #30777 for the unit tests for SymbolUsageAnalysis. This PR is targeting a feature branch, which will get unit tests from #30777 before it gets merged into master or dev16.0-preview2 branch.","created_at":"2018-11-07T20:09:25Z","updated_at":"2018-11-09T00:13:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a3e86a649d5cc86dbf3c84dd5d812edeadbb3f72","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[{"name":"roslyn-ide","id":1781706,"node_id":"MDQ6VGVhbTE3ODE3MDY=","slug":"roslyn-ide","description":"Roslyn IDE Team","privacy":"closed","url":"https://api.github.com/teams/1781706","members_url":"https://api.github.com/teams/1781706/members{/member}","repositories_url":"https://api.github.com/teams/1781706/repos","permission":"pull"}],"labels":[{"id":166377917,"node_id":"MDU6TGFiZWwxNjYzNzc5MTc=","url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-IDE","name":"Area-IDE","color":"5319e7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/31025/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/31025/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/31025/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/3d072d5029b0caa5b64a6474366a3156760b722b","head":{"label":"mavasani:CoreFlowAnalysis","ref":"CoreFlowAnalysis","sha":"3d072d5029b0caa5b64a6474366a3156760b722b","user":{"login":"mavasani","id":10605811,"node_id":"MDQ6VXNlcjEwNjA1ODEx","avatar_url":"https://avatars2.githubusercontent.com/u/10605811?v=4","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},"repo":{"id":30584055,"node_id":"MDEwOlJlcG9zaXRvcnkzMDU4NDA1NQ==","name":"roslyn","full_name":"mavasani/roslyn","private":false,"owner":{"login":"mavasani","id":10605811,"node_id":"MDQ6VXNlcjEwNjA1ODEx","avatar_url":"https://avatars2.githubusercontent.com/u/10605811?v=4","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},"html_url":"https://github.com/mavasani/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":true,"url":"https://api.github.com/repos/mavasani/roslyn","forks_url":"https://api.github.com/repos/mavasani/roslyn/forks","keys_url":"https://api.github.com/repos/mavasani/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mavasani/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mavasani/roslyn/teams","hooks_url":"https://api.github.com/repos/mavasani/roslyn/hooks","issue_events_url":"https://api.github.com/repos/mavasani/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/mavasani/roslyn/events","assignees_url":"https://api.github.com/repos/mavasani/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/mavasani/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/mavasani/roslyn/tags","blobs_url":"https://api.github.com/repos/mavasani/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mavasani/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mavasani/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/mavasani/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mavasani/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/mavasani/roslyn/languages","stargazers_url":"https://api.github.com/repos/mavasani/roslyn/stargazers","contributors_url":"https://api.github.com/repos/mavasani/roslyn/contributors","subscribers_url":"https://api.github.com/repos/mavasani/roslyn/subscribers","subscription_url":"https://api.github.com/repos/mavasani/roslyn/subscription","commits_url":"https://api.github.com/repos/mavasani/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/mavasani/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/mavasani/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/mavasani/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/mavasani/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/mavasani/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mavasani/roslyn/merges","archive_url":"https://api.github.com/repos/mavasani/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mavasani/roslyn/downloads","issues_url":"https://api.github.com/repos/mavasani/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/mavasani/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/mavasani/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/mavasani/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mavasani/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/mavasani/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/mavasani/roslyn/deployments","created_at":"2015-02-10T09:12:41Z","updated_at":"2018-11-06T13:29:35Z","pushed_at":"2018-11-08T21:31:59Z","git_url":"git://github.com/mavasani/roslyn.git","ssh_url":"git@github.com:mavasani/roslyn.git","clone_url":"https://github.com/mavasani/roslyn.git","svn_url":"https://github.com/mavasani/roslyn","homepage":"","size":437886,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:ide-dataflow-analyzer","ref":"ide-dataflow-analyzer","sha":"443784e348618a711c0f26810123c481c62a693d","user":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":29078997,"node_id":"MDEwOlJlcG9zaXRvcnkyOTA3ODk5Nw==","name":"roslyn","full_name":"dotnet/roslyn","private":false,"owner":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dotnet/roslyn","description":"The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn","forks_url":"https://api.github.com/repos/dotnet/roslyn/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/roslyn/deployments","created_at":"2015-01-11T02:39:03Z","updated_at":"2018-11-08T22:08:34Z","pushed_at":"2018-11-09T00:10:51Z","git_url":"git://github.com/dotnet/roslyn.git","ssh_url":"git@github.com:dotnet/roslyn.git","clone_url":"https://github.com/dotnet/roslyn.git","svn_url":"https://github.com/dotnet/roslyn","homepage":"https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/","size":482045,"stargazers_count":10326,"watchers_count":10326,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2447,"mirror_url":null,"archived":false,"open_issues_count":5389,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2447,"open_issues":5389,"watchers":10326,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/31025"},"html":{"href":"https://github.com/dotnet/roslyn/pull/31025"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/31025"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/31025/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/31025/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/31025/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/3d072d5029b0caa5b64a6474366a3156760b722b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"CyrusNajmabadi"}}