{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/74498712","id":74498712,"diff_hunk":"@@ -1686,6 +1790,13 @@ private BoundNode VisitLambdaOrLocalFunction(IBoundLambdaOrFunction node)\n             ImmutableArray<PendingBranch> pendingReturns = RemoveReturns();\n             RestorePending(oldPending);\n             LeaveParameters(node.Symbol.Parameters, node.Syntax, null);\n+\n+            if (recordAssigns)\n+            {\n+                // Check for assignments to captured variables\n+                RecordCapturedAssigns(ref finalState, ref this.State);\n+            }\n+","path":"src/Compilers/CSharp/Portable/FlowAnalysis/DataFlowPass.cs","position":416,"original_position":416,"commit_id":"2095abf99aa31632f863a7db72360536fce469e6","original_commit_id":"2095abf99aa31632f863a7db72360536fce469e6","user":{"login":"gafter","id":3804346,"avatar_url":"https://avatars.githubusercontent.com/u/3804346?v=3","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"body":"This can be below the loop, below, and just record finalState","created_at":"2016-08-11T20:40:49Z","updated_at":"2016-08-11T20:40:49Z","html_url":"https://github.com/dotnet/roslyn/pull/12888#discussion_r74498712","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/12888","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/74498712"},"html":{"href":"https://github.com/dotnet/roslyn/pull/12888#discussion_r74498712"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/12888"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/12888","id":79874489,"html_url":"https://github.com/dotnet/roslyn/pull/12888","diff_url":"https://github.com/dotnet/roslyn/pull/12888.diff","patch_url":"https://github.com/dotnet/roslyn/pull/12888.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/12888","number":12888,"state":"open","locked":false,"title":"Update local function definite assignment with new rules","user":{"login":"agocke","id":515774,"avatar_url":"https://avatars.githubusercontent.com/u/515774?v=3","gravatar_id":"","url":"https://api.github.com/users/agocke","html_url":"https://github.com/agocke","followers_url":"https://api.github.com/users/agocke/followers","following_url":"https://api.github.com/users/agocke/following{/other_user}","gists_url":"https://api.github.com/users/agocke/gists{/gist_id}","starred_url":"https://api.github.com/users/agocke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agocke/subscriptions","organizations_url":"https://api.github.com/users/agocke/orgs","repos_url":"https://api.github.com/users/agocke/repos","events_url":"https://api.github.com/users/agocke/events{/privacy}","received_events_url":"https://api.github.com/users/agocke/received_events","type":"User","site_admin":false},"body":"This PR implements the design changes for flow analysis in local\r\nfunctions, specifically the decision to allow local functions to be\r\ndeclared anywhere in the method and only have captured usages considered\r\nat the local function use site, rather than the declaration site.\r\n\r\nThe key points of the algorithm are as follows:\r\n\r\n    1. Visit local functions recursively:\r\n        a. For each write of a captured variable in the local\r\n           function, record it and mark the local function dirty.\r\n        b. When a local function is used, add the recorded writes\r\n            to the write list for the current local function if the variable\r\n            is still captured.\r\n    2. If there are any dirty local functions, mark them clean and\r\n        goto (1).\r\n    3. Recursively visit the local functions:\r\n        a. Clearing the state before visiting each local function.\r\n        b. Recording all reads from captured variables that may not be\r\n            definitely assigned.\r\n        c. Replaying reads recorded during local function use.\r\n        d. Marking a local function dirty of the set of read variables\r\n            changes.\r\n    4. If there are any dirty local functions, mark them clean and goto (3).\r\n    5. Visit all remaining statements normally, replaying reads and writes\r\n        from the recorded set on every local function use as required.\r\n\r\nFixes #10391.","created_at":"2016-08-03T09:29:01Z","updated_at":"2016-08-11T20:40:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3387a0faaa40f9b1d500bc852af3a976c54adb68","assignee":{"login":"gafter","id":3804346,"avatar_url":"https://avatars.githubusercontent.com/u/3804346?v=3","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"assignees":[{"login":"gafter","id":3804346,"avatar_url":"https://avatars.githubusercontent.com/u/3804346?v=3","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/12888/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/12888/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/12888/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/2095abf99aa31632f863a7db72360536fce469e6","head":{"label":"agocke:def-assignment","ref":"def-assignment","sha":"2095abf99aa31632f863a7db72360536fce469e6","user":{"login":"agocke","id":515774,"avatar_url":"https://avatars.githubusercontent.com/u/515774?v=3","gravatar_id":"","url":"https://api.github.com/users/agocke","html_url":"https://github.com/agocke","followers_url":"https://api.github.com/users/agocke/followers","following_url":"https://api.github.com/users/agocke/following{/other_user}","gists_url":"https://api.github.com/users/agocke/gists{/gist_id}","starred_url":"https://api.github.com/users/agocke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agocke/subscriptions","organizations_url":"https://api.github.com/users/agocke/orgs","repos_url":"https://api.github.com/users/agocke/repos","events_url":"https://api.github.com/users/agocke/events{/privacy}","received_events_url":"https://api.github.com/users/agocke/received_events","type":"User","site_admin":false},"repo":{"id":30560754,"name":"roslyn","full_name":"agocke/roslyn","owner":{"login":"agocke","id":515774,"avatar_url":"https://avatars.githubusercontent.com/u/515774?v=3","gravatar_id":"","url":"https://api.github.com/users/agocke","html_url":"https://github.com/agocke","followers_url":"https://api.github.com/users/agocke/followers","following_url":"https://api.github.com/users/agocke/following{/other_user}","gists_url":"https://api.github.com/users/agocke/gists{/gist_id}","starred_url":"https://api.github.com/users/agocke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agocke/subscriptions","organizations_url":"https://api.github.com/users/agocke/orgs","repos_url":"https://api.github.com/users/agocke/repos","events_url":"https://api.github.com/users/agocke/events{/privacy}","received_events_url":"https://api.github.com/users/agocke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/agocke/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/agocke/roslyn","forks_url":"https://api.github.com/repos/agocke/roslyn/forks","keys_url":"https://api.github.com/repos/agocke/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agocke/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agocke/roslyn/teams","hooks_url":"https://api.github.com/repos/agocke/roslyn/hooks","issue_events_url":"https://api.github.com/repos/agocke/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/agocke/roslyn/events","assignees_url":"https://api.github.com/repos/agocke/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/agocke/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/agocke/roslyn/tags","blobs_url":"https://api.github.com/repos/agocke/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agocke/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agocke/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/agocke/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agocke/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/agocke/roslyn/languages","stargazers_url":"https://api.github.com/repos/agocke/roslyn/stargazers","contributors_url":"https://api.github.com/repos/agocke/roslyn/contributors","subscribers_url":"https://api.github.com/repos/agocke/roslyn/subscribers","subscription_url":"https://api.github.com/repos/agocke/roslyn/subscription","commits_url":"https://api.github.com/repos/agocke/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/agocke/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/agocke/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/agocke/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/agocke/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/agocke/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agocke/roslyn/merges","archive_url":"https://api.github.com/repos/agocke/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agocke/roslyn/downloads","issues_url":"https://api.github.com/repos/agocke/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/agocke/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/agocke/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/agocke/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agocke/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/agocke/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/agocke/roslyn/deployments","created_at":"2015-02-09T21:57:03Z","updated_at":"2016-01-12T21:57:47Z","pushed_at":"2016-08-11T00:16:00Z","git_url":"git://github.com/agocke/roslyn.git","ssh_url":"git@github.com:agocke/roslyn.git","clone_url":"https://github.com/agocke/roslyn.git","svn_url":"https://github.com/agocke/roslyn","homepage":"","size":160871,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"dotnet:features/local-functions","ref":"features/local-functions","sha":"35ca75e2d9ce106f15e3dea8879cdd866d301537","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","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,"name":"roslyn","full_name":"dotnet/roslyn","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","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},"private":false,"html_url":"https://github.com/dotnet/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers 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":"2016-08-11T15:18:24Z","pushed_at":"2016-08-11T20:40:16Z","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":"","size":323375,"stargazers_count":5987,"watchers_count":5987,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1431,"mirror_url":null,"open_issues_count":3093,"forks":1431,"open_issues":3093,"watchers":5987,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/12888"},"html":{"href":"https://github.com/dotnet/roslyn/pull/12888"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/12888"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/12888/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/12888/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/12888/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/2095abf99aa31632f863a7db72360536fce469e6"}}}}
{"actor":{"display_login":"gafter"}}