{"action":"created","comment":{"url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments/38833813","id":38833813,"diff_hunk":"@@ -2111,25 +2110,15 @@ private void EmitVarDeclNode(ImperativeNode node, ref ProtoCore.Type inferedType\n                 }\n                 else\n                 {\n+                    // check whether the variable name is a function name\n+                    if (globalClassIndex != ProtoCore.DSASM.Constants.kGlobalScope)\n                     {\n-                        // check whether the variable name is a function name\n                         bool isAccessibleFp;\n                         int realType;\n-                        ProtoCore.DSASM.ProcedureNode procNode = null;\n-                        if (globalClassIndex != ProtoCore.DSASM.Constants.kGlobalScope)\n-                        {\n-                            procNode = core.ClassTable.ClassNodes[globalClassIndex].GetMemberFunction(t.Name, null, globalClassIndex, out isAccessibleFp, out realType);\n-                        }\n-                        if (procNode == null)\n+                        var procNode = core.ClassTable.ClassNodes[globalClassIndex].GetMemberFunction(t.Name, null, globalClassIndex, out isAccessibleFp, out realType);\n+                        if (procNode != null && procNode.procId != Constants.kInvalidIndex && emitDebugInfo)\n                         {\n-                            procNode = CoreUtils.GetFirstVisibleProcedure(t.Name, null, codeBlock);\n-                        }\n-                        if (procNode != null)\n-                        {\n-                            if (ProtoCore.DSASM.Constants.kInvalidIndex != procNode.procId && emitDebugInfo)\n-                            {\n-                                buildStatus.LogSemanticError(String.Format(Resources.FunctionAsVaribleError,t.Name), core.CurrentDSFileName, t.line, t.col);\n-                            }\n+                            buildStatus.LogSemanticError(String.Format(Resources.FunctionAsVaribleError, t.Name), core.CurrentDSFileName, t.line, t.col);","path":"src/Engine/ProtoImperative/CodeGen.cs","position":46,"original_position":46,"commit_id":"2e2b82dbfc13146d8edd808b7747b0ee869fdfb7","original_commit_id":"2e2b82dbfc13146d8edd808b7747b0ee869fdfb7","user":{"login":"ke-yu","id":2600379,"avatar_url":"https://avatars.githubusercontent.com/u/2600379?v=3","gravatar_id":"","url":"https://api.github.com/users/ke-yu","html_url":"https://github.com/ke-yu","followers_url":"https://api.github.com/users/ke-yu/followers","following_url":"https://api.github.com/users/ke-yu/following{/other_user}","gists_url":"https://api.github.com/users/ke-yu/gists{/gist_id}","starred_url":"https://api.github.com/users/ke-yu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ke-yu/subscriptions","organizations_url":"https://api.github.com/users/ke-yu/orgs","repos_url":"https://api.github.com/users/ke-yu/repos","events_url":"https://api.github.com/users/ke-yu/events{/privacy}","received_events_url":"https://api.github.com/users/ke-yu/received_events","type":"User","site_admin":false},"body":"Log a warning if *member variable* name shadows a function name. Try to be aligned with C# behavior. ","created_at":"2015-09-07T05:08:46Z","updated_at":"2015-09-07T05:08:46Z","html_url":"https://github.com/DynamoDS/Dynamo/pull/5205#discussion_r38833813","pull_request_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/5205","_links":{"self":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments/38833813"},"html":{"href":"https://github.com/DynamoDS/Dynamo/pull/5205#discussion_r38833813"},"pull_request":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/5205"}}},"pull_request":{"url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/5205","id":43737069,"html_url":"https://github.com/DynamoDS/Dynamo/pull/5205","diff_url":"https://github.com/DynamoDS/Dynamo/pull/5205.diff","patch_url":"https://github.com/DynamoDS/Dynamo/pull/5205.patch","issue_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/5205","number":5205,"state":"open","locked":false,"title":"Fix issue that parameter name doesn't shadow function name","user":{"login":"ke-yu","id":2600379,"avatar_url":"https://avatars.githubusercontent.com/u/2600379?v=3","gravatar_id":"","url":"https://api.github.com/users/ke-yu","html_url":"https://github.com/ke-yu","followers_url":"https://api.github.com/users/ke-yu/followers","following_url":"https://api.github.com/users/ke-yu/following{/other_user}","gists_url":"https://api.github.com/users/ke-yu/gists{/gist_id}","starred_url":"https://api.github.com/users/ke-yu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ke-yu/subscriptions","organizations_url":"https://api.github.com/users/ke-yu/orgs","repos_url":"https://api.github.com/users/ke-yu/repos","events_url":"https://api.github.com/users/ke-yu/events{/privacy}","received_events_url":"https://api.github.com/users/ke-yu/received_events","type":"User","site_admin":false},"body":"### Purpose\r\n\r\nThis is to fix defect [MAGN 7807 When typing DS code in CBN if the function name and argument passed to the function are same it does not throw error](http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-7807).\r\n\r\nBasically this fix extends variable shadowing to allows variables/parameters to mask function names. For example:\r\n* Parameter name masks function name\r\n```\r\ndef foo(foo)\r\n{\r\n    return = foo + 2;\r\n}\r\nx = foo(3);   // x is 5 after execution\r\n```\r\n* Variable name masks function name\r\n```\r\ndef foo()\r\n{\r\n    foo = 21;\r\n    return = foo;\r\n}\r\nx = foo();     // x is 21 after execution\r\n```\r\n\r\n```\r\ndef foo()\r\n{\r\n    return = 21;\r\n}\r\nfoo = 2;\r\nx = foo;      // x is 2\r\n```\r\n\r\n### Declarations\r\n\r\nCheck these if you believe they are true\r\n\r\n- [ ] The code base is in a better state after this PR\r\n- [ ] Is documented according to the [standards](https://github.com/DynamoDS/Dynamo/wiki/Coding-Standards)\r\n- [ ] The level of testing this PR includes is appropriate\r\n- [ ] User facing strings, if any, are extracted into `*.resx` files\r\n\r\n### Reviewers\r\n@aparajit-pratap  PTAL.","created_at":"2015-08-31T07:02:15Z","updated_at":"2015-09-07T05:08:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"343945a65d06bc2540f654bf33eafe4b2d0a390e","assignee":{"login":"aparajit-pratap","id":5710686,"avatar_url":"https://avatars.githubusercontent.com/u/5710686?v=3","gravatar_id":"","url":"https://api.github.com/users/aparajit-pratap","html_url":"https://github.com/aparajit-pratap","followers_url":"https://api.github.com/users/aparajit-pratap/followers","following_url":"https://api.github.com/users/aparajit-pratap/following{/other_user}","gists_url":"https://api.github.com/users/aparajit-pratap/gists{/gist_id}","starred_url":"https://api.github.com/users/aparajit-pratap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aparajit-pratap/subscriptions","organizations_url":"https://api.github.com/users/aparajit-pratap/orgs","repos_url":"https://api.github.com/users/aparajit-pratap/repos","events_url":"https://api.github.com/users/aparajit-pratap/events{/privacy}","received_events_url":"https://api.github.com/users/aparajit-pratap/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/5205/commits","review_comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/5205/comments","review_comment_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/5205/comments","statuses_url":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/2e2b82dbfc13146d8edd808b7747b0ee869fdfb7","head":{"label":"ke-yu:magn7807","ref":"magn7807","sha":"2e2b82dbfc13146d8edd808b7747b0ee869fdfb7","user":{"login":"ke-yu","id":2600379,"avatar_url":"https://avatars.githubusercontent.com/u/2600379?v=3","gravatar_id":"","url":"https://api.github.com/users/ke-yu","html_url":"https://github.com/ke-yu","followers_url":"https://api.github.com/users/ke-yu/followers","following_url":"https://api.github.com/users/ke-yu/following{/other_user}","gists_url":"https://api.github.com/users/ke-yu/gists{/gist_id}","starred_url":"https://api.github.com/users/ke-yu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ke-yu/subscriptions","organizations_url":"https://api.github.com/users/ke-yu/orgs","repos_url":"https://api.github.com/users/ke-yu/repos","events_url":"https://api.github.com/users/ke-yu/events{/privacy}","received_events_url":"https://api.github.com/users/ke-yu/received_events","type":"User","site_admin":false},"repo":{"id":18300645,"name":"Dynamo","full_name":"ke-yu/Dynamo","owner":{"login":"ke-yu","id":2600379,"avatar_url":"https://avatars.githubusercontent.com/u/2600379?v=3","gravatar_id":"","url":"https://api.github.com/users/ke-yu","html_url":"https://github.com/ke-yu","followers_url":"https://api.github.com/users/ke-yu/followers","following_url":"https://api.github.com/users/ke-yu/following{/other_user}","gists_url":"https://api.github.com/users/ke-yu/gists{/gist_id}","starred_url":"https://api.github.com/users/ke-yu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ke-yu/subscriptions","organizations_url":"https://api.github.com/users/ke-yu/orgs","repos_url":"https://api.github.com/users/ke-yu/repos","events_url":"https://api.github.com/users/ke-yu/events{/privacy}","received_events_url":"https://api.github.com/users/ke-yu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ke-yu/Dynamo","description":"Visual Programming For Revit","fork":true,"url":"https://api.github.com/repos/ke-yu/Dynamo","forks_url":"https://api.github.com/repos/ke-yu/Dynamo/forks","keys_url":"https://api.github.com/repos/ke-yu/Dynamo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ke-yu/Dynamo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ke-yu/Dynamo/teams","hooks_url":"https://api.github.com/repos/ke-yu/Dynamo/hooks","issue_events_url":"https://api.github.com/repos/ke-yu/Dynamo/issues/events{/number}","events_url":"https://api.github.com/repos/ke-yu/Dynamo/events","assignees_url":"https://api.github.com/repos/ke-yu/Dynamo/assignees{/user}","branches_url":"https://api.github.com/repos/ke-yu/Dynamo/branches{/branch}","tags_url":"https://api.github.com/repos/ke-yu/Dynamo/tags","blobs_url":"https://api.github.com/repos/ke-yu/Dynamo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ke-yu/Dynamo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ke-yu/Dynamo/git/refs{/sha}","trees_url":"https://api.github.com/repos/ke-yu/Dynamo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ke-yu/Dynamo/statuses/{sha}","languages_url":"https://api.github.com/repos/ke-yu/Dynamo/languages","stargazers_url":"https://api.github.com/repos/ke-yu/Dynamo/stargazers","contributors_url":"https://api.github.com/repos/ke-yu/Dynamo/contributors","subscribers_url":"https://api.github.com/repos/ke-yu/Dynamo/subscribers","subscription_url":"https://api.github.com/repos/ke-yu/Dynamo/subscription","commits_url":"https://api.github.com/repos/ke-yu/Dynamo/commits{/sha}","git_commits_url":"https://api.github.com/repos/ke-yu/Dynamo/git/commits{/sha}","comments_url":"https://api.github.com/repos/ke-yu/Dynamo/comments{/number}","issue_comment_url":"https://api.github.com/repos/ke-yu/Dynamo/issues/comments{/number}","contents_url":"https://api.github.com/repos/ke-yu/Dynamo/contents/{+path}","compare_url":"https://api.github.com/repos/ke-yu/Dynamo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ke-yu/Dynamo/merges","archive_url":"https://api.github.com/repos/ke-yu/Dynamo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ke-yu/Dynamo/downloads","issues_url":"https://api.github.com/repos/ke-yu/Dynamo/issues{/number}","pulls_url":"https://api.github.com/repos/ke-yu/Dynamo/pulls{/number}","milestones_url":"https://api.github.com/repos/ke-yu/Dynamo/milestones{/number}","notifications_url":"https://api.github.com/repos/ke-yu/Dynamo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ke-yu/Dynamo/labels{/name}","releases_url":"https://api.github.com/repos/ke-yu/Dynamo/releases{/id}","created_at":"2014-03-31T16:53:50Z","updated_at":"2014-06-26T05:45:55Z","pushed_at":"2015-09-04T02:59:04Z","git_url":"git://github.com/ke-yu/Dynamo.git","ssh_url":"git@github.com:ke-yu/Dynamo.git","clone_url":"https://github.com/ke-yu/Dynamo.git","svn_url":"https://github.com/ke-yu/Dynamo","homepage":"http://dynamobim.org","size":739454,"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":"DynamoDS:master","ref":"master","sha":"e6390e43e250b0b795351e1b5b77636efef4705c","user":{"login":"DynamoDS","id":6528209,"avatar_url":"https://avatars.githubusercontent.com/u/6528209?v=3","gravatar_id":"","url":"https://api.github.com/users/DynamoDS","html_url":"https://github.com/DynamoDS","followers_url":"https://api.github.com/users/DynamoDS/followers","following_url":"https://api.github.com/users/DynamoDS/following{/other_user}","gists_url":"https://api.github.com/users/DynamoDS/gists{/gist_id}","starred_url":"https://api.github.com/users/DynamoDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DynamoDS/subscriptions","organizations_url":"https://api.github.com/users/DynamoDS/orgs","repos_url":"https://api.github.com/users/DynamoDS/repos","events_url":"https://api.github.com/users/DynamoDS/events{/privacy}","received_events_url":"https://api.github.com/users/DynamoDS/received_events","type":"Organization","site_admin":false},"repo":{"id":3395179,"name":"Dynamo","full_name":"DynamoDS/Dynamo","owner":{"login":"DynamoDS","id":6528209,"avatar_url":"https://avatars.githubusercontent.com/u/6528209?v=3","gravatar_id":"","url":"https://api.github.com/users/DynamoDS","html_url":"https://github.com/DynamoDS","followers_url":"https://api.github.com/users/DynamoDS/followers","following_url":"https://api.github.com/users/DynamoDS/following{/other_user}","gists_url":"https://api.github.com/users/DynamoDS/gists{/gist_id}","starred_url":"https://api.github.com/users/DynamoDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DynamoDS/subscriptions","organizations_url":"https://api.github.com/users/DynamoDS/orgs","repos_url":"https://api.github.com/users/DynamoDS/repos","events_url":"https://api.github.com/users/DynamoDS/events{/privacy}","received_events_url":"https://api.github.com/users/DynamoDS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DynamoDS/Dynamo","description":"Visual Programming","fork":false,"url":"https://api.github.com/repos/DynamoDS/Dynamo","forks_url":"https://api.github.com/repos/DynamoDS/Dynamo/forks","keys_url":"https://api.github.com/repos/DynamoDS/Dynamo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DynamoDS/Dynamo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DynamoDS/Dynamo/teams","hooks_url":"https://api.github.com/repos/DynamoDS/Dynamo/hooks","issue_events_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/events{/number}","events_url":"https://api.github.com/repos/DynamoDS/Dynamo/events","assignees_url":"https://api.github.com/repos/DynamoDS/Dynamo/assignees{/user}","branches_url":"https://api.github.com/repos/DynamoDS/Dynamo/branches{/branch}","tags_url":"https://api.github.com/repos/DynamoDS/Dynamo/tags","blobs_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/refs{/sha}","trees_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/{sha}","languages_url":"https://api.github.com/repos/DynamoDS/Dynamo/languages","stargazers_url":"https://api.github.com/repos/DynamoDS/Dynamo/stargazers","contributors_url":"https://api.github.com/repos/DynamoDS/Dynamo/contributors","subscribers_url":"https://api.github.com/repos/DynamoDS/Dynamo/subscribers","subscription_url":"https://api.github.com/repos/DynamoDS/Dynamo/subscription","commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/commits{/sha}","git_commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/commits{/sha}","comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/comments{/number}","issue_comment_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/comments{/number}","contents_url":"https://api.github.com/repos/DynamoDS/Dynamo/contents/{+path}","compare_url":"https://api.github.com/repos/DynamoDS/Dynamo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DynamoDS/Dynamo/merges","archive_url":"https://api.github.com/repos/DynamoDS/Dynamo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DynamoDS/Dynamo/downloads","issues_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues{/number}","pulls_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls{/number}","milestones_url":"https://api.github.com/repos/DynamoDS/Dynamo/milestones{/number}","notifications_url":"https://api.github.com/repos/DynamoDS/Dynamo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DynamoDS/Dynamo/labels{/name}","releases_url":"https://api.github.com/repos/DynamoDS/Dynamo/releases{/id}","created_at":"2012-02-09T07:35:33Z","updated_at":"2015-09-01T09:38:18Z","pushed_at":"2015-09-07T03:02:42Z","git_url":"git://github.com/DynamoDS/Dynamo.git","ssh_url":"git@github.com:DynamoDS/Dynamo.git","clone_url":"https://github.com/DynamoDS/Dynamo.git","svn_url":"https://github.com/DynamoDS/Dynamo","homepage":"http://dynamobim.org","size":1028571,"stargazers_count":254,"watchers_count":254,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":199,"mirror_url":null,"open_issues_count":737,"forks":199,"open_issues":737,"watchers":254,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/5205"},"html":{"href":"https://github.com/DynamoDS/Dynamo/pull/5205"},"issue":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/issues/5205"},"comments":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/issues/5205/comments"},"review_comments":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/5205/comments"},"review_comment":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/5205/commits"},"statuses":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/2e2b82dbfc13146d8edd808b7747b0ee869fdfb7"}}}}