{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/33727115","id":33727115,"diff_hunk":"@@ -381,28 +381,23 @@ private bool ReportConflictWithLocal(Symbol local, Symbol newSymbol, string name\n \n             if (newSymbolKind == SymbolKind.ErrorType) return true;\n \n-            if (newSymbolKind == SymbolKind.Local)\n-            {\n-                if (this.Locals.Contains((LocalSymbol)newSymbol) && newLocation.SourceSpan.Start >= local.Locations[0].SourceSpan.Start)\n-                {\n-                    // A local variable named '{0}' is already defined in this scope\n-                    diagnostics.Add(ErrorCode.ERR_LocalDuplicate, newLocation, name);\n-                    return true;\n-                }\n-            }\n+            var declaredInThisScope = false;\n+\n+            declaredInThisScope |= newSymbolKind == SymbolKind.Local && this.Locals.Contains((LocalSymbol)newSymbol);\n+            declaredInThisScope |= newSymbolKind == SymbolKind.Method && this.LocalFunctions.Contains((LocalFunctionSymbol)newSymbol);\n \n-            if (newSymbolKind == SymbolKind.Method)\n+            if (declaredInThisScope && newLocation.SourceSpan.Start >= local.Locations[0].SourceSpan.Start)\n             {\n-                if (this.LocalFunctions.Contains((LocalFunctionSymbol)newSymbol) && newLocation.SourceSpan.Start >= local.Locations[0].SourceSpan.Start)\n-                {\n-                    // A local variable named '{0}' is already defined in this scope\n-                    diagnostics.Add(ErrorCode.ERR_LocalDuplicate, newLocation, name);\n-                    return true;\n-                }\n+                // TODO: Message should change to something like \"A {0} named '{1}' is already defined in this scope\"","path":"src/Compilers/CSharp/Portable/Binder/LocalScopeBinder.cs","position":27,"original_position":27,"commit_id":"037f4a6229d7b3a93d144b0b2e882a3b96ac20fc","original_commit_id":"037f4a6229d7b3a93d144b0b2e882a3b96ac20fc","user":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"body":"Also fine to add an entry into the local-functions.md file.  ","created_at":"2015-07-01T21:32:38Z","updated_at":"2015-07-01T21:32:38Z","html_url":"https://github.com/dotnet/roslyn/pull/3775#discussion_r33727115","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/3775","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/33727115"},"html":{"href":"https://github.com/dotnet/roslyn/pull/3775#discussion_r33727115"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/3775"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/3775","id":39000193,"html_url":"https://github.com/dotnet/roslyn/pull/3775","diff_url":"https://github.com/dotnet/roslyn/pull/3775.diff","patch_url":"https://github.com/dotnet/roslyn/pull/3775.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/3775","number":3775,"state":"open","locked":false,"title":"Local functions update 3","user":{"login":"khyperia","id":953151,"avatar_url":"https://avatars.githubusercontent.com/u/953151?v=3","gravatar_id":"","url":"https://api.github.com/users/khyperia","html_url":"https://github.com/khyperia","followers_url":"https://api.github.com/users/khyperia/followers","following_url":"https://api.github.com/users/khyperia/following{/other_user}","gists_url":"https://api.github.com/users/khyperia/gists{/gist_id}","starred_url":"https://api.github.com/users/khyperia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khyperia/subscriptions","organizations_url":"https://api.github.com/users/khyperia/orgs","repos_url":"https://api.github.com/users/khyperia/repos","events_url":"https://api.github.com/users/khyperia/events{/privacy}","received_events_url":"https://api.github.com/users/khyperia/received_events","type":"User","site_admin":false},"body":"Third PR for local functions.\r\n\r\nThings in this PR:\r\n\r\n* Generic local functions now fully work in the EE\r\n* Closure optimization: if a local function is never converted to a delegate, make its closure class be a struct (passed by ref, via the `this` parameter).\r\n* Bugfixes: inferred return type with async/iterator, name conflicts with type parameters.\r\n* Refactored unit tests to be more split up (as opposed to \"test a huge number of features in a single unit test\") and less verbose.\r\n\r\nFYI @jaredpar @VSadov @agocke The last commit, \"Optimize local function closures into structs\", probably needs more review than the rest. There's complex stuff going on in there, and may not be implemented in the most optimal way. Talk to me if you'd like to see what it's doing, and possibly give advice on how to improve it.","created_at":"2015-07-01T16:26:36Z","updated_at":"2015-07-01T21:32:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ce92052cdd21c9b3c407c1c3509fde18e49ea55","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/3775/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/3775/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/3775/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/037f4a6229d7b3a93d144b0b2e882a3b96ac20fc","head":{"label":"khyperia:LocalFunctions","ref":"LocalFunctions","sha":"037f4a6229d7b3a93d144b0b2e882a3b96ac20fc","user":{"login":"khyperia","id":953151,"avatar_url":"https://avatars.githubusercontent.com/u/953151?v=3","gravatar_id":"","url":"https://api.github.com/users/khyperia","html_url":"https://github.com/khyperia","followers_url":"https://api.github.com/users/khyperia/followers","following_url":"https://api.github.com/users/khyperia/following{/other_user}","gists_url":"https://api.github.com/users/khyperia/gists{/gist_id}","starred_url":"https://api.github.com/users/khyperia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khyperia/subscriptions","organizations_url":"https://api.github.com/users/khyperia/orgs","repos_url":"https://api.github.com/users/khyperia/repos","events_url":"https://api.github.com/users/khyperia/events{/privacy}","received_events_url":"https://api.github.com/users/khyperia/received_events","type":"User","site_admin":false},"repo":{"id":35454040,"name":"roslyn","full_name":"khyperia/roslyn","owner":{"login":"khyperia","id":953151,"avatar_url":"https://avatars.githubusercontent.com/u/953151?v=3","gravatar_id":"","url":"https://api.github.com/users/khyperia","html_url":"https://github.com/khyperia","followers_url":"https://api.github.com/users/khyperia/followers","following_url":"https://api.github.com/users/khyperia/following{/other_user}","gists_url":"https://api.github.com/users/khyperia/gists{/gist_id}","starred_url":"https://api.github.com/users/khyperia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khyperia/subscriptions","organizations_url":"https://api.github.com/users/khyperia/orgs","repos_url":"https://api.github.com/users/khyperia/repos","events_url":"https://api.github.com/users/khyperia/events{/privacy}","received_events_url":"https://api.github.com/users/khyperia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/khyperia/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/khyperia/roslyn","forks_url":"https://api.github.com/repos/khyperia/roslyn/forks","keys_url":"https://api.github.com/repos/khyperia/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/khyperia/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/khyperia/roslyn/teams","hooks_url":"https://api.github.com/repos/khyperia/roslyn/hooks","issue_events_url":"https://api.github.com/repos/khyperia/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/khyperia/roslyn/events","assignees_url":"https://api.github.com/repos/khyperia/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/khyperia/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/khyperia/roslyn/tags","blobs_url":"https://api.github.com/repos/khyperia/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/khyperia/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/khyperia/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/khyperia/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/khyperia/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/khyperia/roslyn/languages","stargazers_url":"https://api.github.com/repos/khyperia/roslyn/stargazers","contributors_url":"https://api.github.com/repos/khyperia/roslyn/contributors","subscribers_url":"https://api.github.com/repos/khyperia/roslyn/subscribers","subscription_url":"https://api.github.com/repos/khyperia/roslyn/subscription","commits_url":"https://api.github.com/repos/khyperia/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/khyperia/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/khyperia/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/khyperia/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/khyperia/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/khyperia/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/khyperia/roslyn/merges","archive_url":"https://api.github.com/repos/khyperia/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/khyperia/roslyn/downloads","issues_url":"https://api.github.com/repos/khyperia/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/khyperia/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/khyperia/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/khyperia/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/khyperia/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/khyperia/roslyn/releases{/id}","created_at":"2015-05-11T22:43:33Z","updated_at":"2015-05-11T22:44:02Z","pushed_at":"2015-07-01T16:10:42Z","git_url":"git://github.com/khyperia/roslyn.git","ssh_url":"git@github.com:khyperia/roslyn.git","clone_url":"https://github.com/khyperia/roslyn.git","svn_url":"https://github.com/khyperia/roslyn","homepage":"","size":84887,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:features/local-functions","ref":"features/local-functions","sha":"fc75c74ecfa65a9adf4fafde6767c33d104c1c24","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}","created_at":"2015-01-11T02:39:03Z","updated_at":"2015-07-01T19:28:25Z","pushed_at":"2015-07-01T21:31:18Z","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":147297,"stargazers_count":2595,"watchers_count":2595,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":565,"mirror_url":null,"open_issues_count":1078,"forks":565,"open_issues":1078,"watchers":2595,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/3775"},"html":{"href":"https://github.com/dotnet/roslyn/pull/3775"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/3775"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/3775/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/3775/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/3775/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/037f4a6229d7b3a93d144b0b2e882a3b96ac20fc"}}}}