{"action":"created","comment":{"url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/comments/221520530","pull_request_review_id":160186007,"id":221520530,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTUyMDUzMA==","diff_hunk":"@@ -59,6 +62,7 @@\n     public Set<CompilerPhase> completedPhases;\n     public List<BSymbol> objAttachedFunctions;\n     public List<TopLevelNode> topLevelNodes;\n+    public Queue<BLangLambdaFunction> lambdaFunctions = new ArrayDeque<>();","path":"compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangPackage.java","position":19,"original_position":19,"commit_id":"59b5b995bd28b44507bc5eee4e1a276ad46e439f","original_commit_id":"59b5b995bd28b44507bc5eee4e1a276ad46e439f","user":{"login":"Kishanthan","id":690559,"node_id":"MDQ6VXNlcjY5MDU1OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/690559?v=4","gravatar_id":"","url":"https://api.github.com/users/Kishanthan","html_url":"https://github.com/Kishanthan","followers_url":"https://api.github.com/users/Kishanthan/followers","following_url":"https://api.github.com/users/Kishanthan/following{/other_user}","gists_url":"https://api.github.com/users/Kishanthan/gists{/gist_id}","starred_url":"https://api.github.com/users/Kishanthan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kishanthan/subscriptions","organizations_url":"https://api.github.com/users/Kishanthan/orgs","repos_url":"https://api.github.com/users/Kishanthan/repos","events_url":"https://api.github.com/users/Kishanthan/events{/privacy}","received_events_url":"https://api.github.com/users/Kishanthan/received_events","type":"User","site_admin":false},"body":"Lets explain why we have an dequeue here","created_at":"2018-10-01T07:59:02Z","updated_at":"2018-10-01T07:59:03Z","html_url":"https://github.com/ballerina-platform/ballerina-lang/pull/10625#discussion_r221520530","pull_request_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/10625","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/comments/221520530"},"html":{"href":"https://github.com/ballerina-platform/ballerina-lang/pull/10625#discussion_r221520530"},"pull_request":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/10625"}}},"pull_request":{"url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/10625","id":219259561,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5MjU5NTYx","html_url":"https://github.com/ballerina-platform/ballerina-lang/pull/10625","diff_url":"https://github.com/ballerina-platform/ballerina-lang/pull/10625.diff","patch_url":"https://github.com/ballerina-platform/ballerina-lang/pull/10625.patch","issue_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/10625","number":10625,"state":"open","locked":false,"title":"Refactor of anonymous functions in Semantic Phase","user":{"login":"Anoukh","id":8677511,"node_id":"MDQ6VXNlcjg2Nzc1MTE=","avatar_url":"https://avatars3.githubusercontent.com/u/8677511?v=4","gravatar_id":"","url":"https://api.github.com/users/Anoukh","html_url":"https://github.com/Anoukh","followers_url":"https://api.github.com/users/Anoukh/followers","following_url":"https://api.github.com/users/Anoukh/following{/other_user}","gists_url":"https://api.github.com/users/Anoukh/gists{/gist_id}","starred_url":"https://api.github.com/users/Anoukh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anoukh/subscriptions","organizations_url":"https://api.github.com/users/Anoukh/orgs","repos_url":"https://api.github.com/users/Anoukh/repos","events_url":"https://api.github.com/users/Anoukh/events{/privacy}","received_events_url":"https://api.github.com/users/Anoukh/received_events","type":"User","site_admin":false},"body":"## Purpose\r\nPurpose of the refactor is to avoid going back to semantic analyzer from type checker when type checking an anonymous function\r\n\r\n## Approach\r\n\r\n- ` BLangPackage` will have a `Queue<BLangLambdaFunction>` to hold the anonymous functions. At type checker when we have to visit an anonymous function, instead of visiting, it will be added to this queue so that we can visit it at the end of the semantic phase.\r\n- For closures to work, we create a deep copy of the `env` at the instance where `BLangLambdaFunction` is visited at the type checker and cache it. This copy of env is used when analyzing the anonymous function at the end of the semantic phase.\r\n\r\n","created_at":"2018-10-01T04:54:48Z","updated_at":"2018-10-01T07:59:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e43e32b7b721f0b739baf56c2d8b41e3b1912c85","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":828131123,"node_id":"MDU6TGFiZWw4MjgxMzExMjM=","url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/labels/Component/Compiler","name":"Component/Compiler","color":"0b6664","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/10625/commits","review_comments_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/10625/comments","review_comment_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/10625/comments","statuses_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/statuses/59b5b995bd28b44507bc5eee4e1a276ad46e439f","head":{"label":"Anoukh:lambda-refactor","ref":"lambda-refactor","sha":"59b5b995bd28b44507bc5eee4e1a276ad46e439f","user":{"login":"Anoukh","id":8677511,"node_id":"MDQ6VXNlcjg2Nzc1MTE=","avatar_url":"https://avatars3.githubusercontent.com/u/8677511?v=4","gravatar_id":"","url":"https://api.github.com/users/Anoukh","html_url":"https://github.com/Anoukh","followers_url":"https://api.github.com/users/Anoukh/followers","following_url":"https://api.github.com/users/Anoukh/following{/other_user}","gists_url":"https://api.github.com/users/Anoukh/gists{/gist_id}","starred_url":"https://api.github.com/users/Anoukh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anoukh/subscriptions","organizations_url":"https://api.github.com/users/Anoukh/orgs","repos_url":"https://api.github.com/users/Anoukh/repos","events_url":"https://api.github.com/users/Anoukh/events{/privacy}","received_events_url":"https://api.github.com/users/Anoukh/received_events","type":"User","site_admin":false},"repo":{"id":119517989,"node_id":"MDEwOlJlcG9zaXRvcnkxMTk1MTc5ODk=","name":"ballerina-lang","full_name":"Anoukh/ballerina-lang","private":false,"owner":{"login":"Anoukh","id":8677511,"node_id":"MDQ6VXNlcjg2Nzc1MTE=","avatar_url":"https://avatars3.githubusercontent.com/u/8677511?v=4","gravatar_id":"","url":"https://api.github.com/users/Anoukh","html_url":"https://github.com/Anoukh","followers_url":"https://api.github.com/users/Anoukh/followers","following_url":"https://api.github.com/users/Anoukh/following{/other_user}","gists_url":"https://api.github.com/users/Anoukh/gists{/gist_id}","starred_url":"https://api.github.com/users/Anoukh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anoukh/subscriptions","organizations_url":"https://api.github.com/users/Anoukh/orgs","repos_url":"https://api.github.com/users/Anoukh/repos","events_url":"https://api.github.com/users/Anoukh/events{/privacy}","received_events_url":"https://api.github.com/users/Anoukh/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Anoukh/ballerina-lang","description":"Ballerina is a new programming language for integration built on a sequence diagram metaphor.","fork":true,"url":"https://api.github.com/repos/Anoukh/ballerina-lang","forks_url":"https://api.github.com/repos/Anoukh/ballerina-lang/forks","keys_url":"https://api.github.com/repos/Anoukh/ballerina-lang/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Anoukh/ballerina-lang/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Anoukh/ballerina-lang/teams","hooks_url":"https://api.github.com/repos/Anoukh/ballerina-lang/hooks","issue_events_url":"https://api.github.com/repos/Anoukh/ballerina-lang/issues/events{/number}","events_url":"https://api.github.com/repos/Anoukh/ballerina-lang/events","assignees_url":"https://api.github.com/repos/Anoukh/ballerina-lang/assignees{/user}","branches_url":"https://api.github.com/repos/Anoukh/ballerina-lang/branches{/branch}","tags_url":"https://api.github.com/repos/Anoukh/ballerina-lang/tags","blobs_url":"https://api.github.com/repos/Anoukh/ballerina-lang/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Anoukh/ballerina-lang/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Anoukh/ballerina-lang/git/refs{/sha}","trees_url":"https://api.github.com/repos/Anoukh/ballerina-lang/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Anoukh/ballerina-lang/statuses/{sha}","languages_url":"https://api.github.com/repos/Anoukh/ballerina-lang/languages","stargazers_url":"https://api.github.com/repos/Anoukh/ballerina-lang/stargazers","contributors_url":"https://api.github.com/repos/Anoukh/ballerina-lang/contributors","subscribers_url":"https://api.github.com/repos/Anoukh/ballerina-lang/subscribers","subscription_url":"https://api.github.com/repos/Anoukh/ballerina-lang/subscription","commits_url":"https://api.github.com/repos/Anoukh/ballerina-lang/commits{/sha}","git_commits_url":"https://api.github.com/repos/Anoukh/ballerina-lang/git/commits{/sha}","comments_url":"https://api.github.com/repos/Anoukh/ballerina-lang/comments{/number}","issue_comment_url":"https://api.github.com/repos/Anoukh/ballerina-lang/issues/comments{/number}","contents_url":"https://api.github.com/repos/Anoukh/ballerina-lang/contents/{+path}","compare_url":"https://api.github.com/repos/Anoukh/ballerina-lang/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Anoukh/ballerina-lang/merges","archive_url":"https://api.github.com/repos/Anoukh/ballerina-lang/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Anoukh/ballerina-lang/downloads","issues_url":"https://api.github.com/repos/Anoukh/ballerina-lang/issues{/number}","pulls_url":"https://api.github.com/repos/Anoukh/ballerina-lang/pulls{/number}","milestones_url":"https://api.github.com/repos/Anoukh/ballerina-lang/milestones{/number}","notifications_url":"https://api.github.com/repos/Anoukh/ballerina-lang/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Anoukh/ballerina-lang/labels{/name}","releases_url":"https://api.github.com/repos/Anoukh/ballerina-lang/releases{/id}","deployments_url":"https://api.github.com/repos/Anoukh/ballerina-lang/deployments","created_at":"2018-01-30T10:05:20Z","updated_at":"2018-10-01T04:42:59Z","pushed_at":"2018-10-01T05:19:11Z","git_url":"git://github.com/Anoukh/ballerina-lang.git","ssh_url":"git@github.com:Anoukh/ballerina-lang.git","clone_url":"https://github.com/Anoukh/ballerina-lang.git","svn_url":"https://github.com/Anoukh/ballerina-lang","homepage":"","size":256190,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ballerina-platform:master","ref":"master","sha":"a6ec2e8e90de483d2335cae6f94844d2dcc07ff3","user":{"login":"ballerina-platform","id":34733518,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NzMzNTE4","avatar_url":"https://avatars2.githubusercontent.com/u/34733518?v=4","gravatar_id":"","url":"https://api.github.com/users/ballerina-platform","html_url":"https://github.com/ballerina-platform","followers_url":"https://api.github.com/users/ballerina-platform/followers","following_url":"https://api.github.com/users/ballerina-platform/following{/other_user}","gists_url":"https://api.github.com/users/ballerina-platform/gists{/gist_id}","starred_url":"https://api.github.com/users/ballerina-platform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ballerina-platform/subscriptions","organizations_url":"https://api.github.com/users/ballerina-platform/orgs","repos_url":"https://api.github.com/users/ballerina-platform/repos","events_url":"https://api.github.com/users/ballerina-platform/events{/privacy}","received_events_url":"https://api.github.com/users/ballerina-platform/received_events","type":"Organization","site_admin":false},"repo":{"id":73930305,"node_id":"MDEwOlJlcG9zaXRvcnk3MzkzMDMwNQ==","name":"ballerina-lang","full_name":"ballerina-platform/ballerina-lang","private":false,"owner":{"login":"ballerina-platform","id":34733518,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NzMzNTE4","avatar_url":"https://avatars2.githubusercontent.com/u/34733518?v=4","gravatar_id":"","url":"https://api.github.com/users/ballerina-platform","html_url":"https://github.com/ballerina-platform","followers_url":"https://api.github.com/users/ballerina-platform/followers","following_url":"https://api.github.com/users/ballerina-platform/following{/other_user}","gists_url":"https://api.github.com/users/ballerina-platform/gists{/gist_id}","starred_url":"https://api.github.com/users/ballerina-platform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ballerina-platform/subscriptions","organizations_url":"https://api.github.com/users/ballerina-platform/orgs","repos_url":"https://api.github.com/users/ballerina-platform/repos","events_url":"https://api.github.com/users/ballerina-platform/events{/privacy}","received_events_url":"https://api.github.com/users/ballerina-platform/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ballerina-platform/ballerina-lang","description":"Ballerina is a compiled, transactional, statically and strongly typed programming language with textual and graphical syntaxes.","fork":false,"url":"https://api.github.com/repos/ballerina-platform/ballerina-lang","forks_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/forks","keys_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/teams","hooks_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/hooks","issue_events_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/events{/number}","events_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/events","assignees_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/assignees{/user}","branches_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/branches{/branch}","tags_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/tags","blobs_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/git/refs{/sha}","trees_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/statuses/{sha}","languages_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/languages","stargazers_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/stargazers","contributors_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/contributors","subscribers_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/subscribers","subscription_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/subscription","commits_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/commits{/sha}","git_commits_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/git/commits{/sha}","comments_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/comments{/number}","issue_comment_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/comments{/number}","contents_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/contents/{+path}","compare_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/merges","archive_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/downloads","issues_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues{/number}","pulls_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls{/number}","milestones_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/milestones{/number}","notifications_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/labels{/name}","releases_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/releases{/id}","deployments_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/deployments","created_at":"2016-11-16T14:58:44Z","updated_at":"2018-10-01T05:56:36Z","pushed_at":"2018-10-01T07:35:34Z","git_url":"git://github.com/ballerina-platform/ballerina-lang.git","ssh_url":"git@github.com:ballerina-platform/ballerina-lang.git","clone_url":"https://github.com/ballerina-platform/ballerina-lang.git","svn_url":"https://github.com/ballerina-platform/ballerina-lang","homepage":"","size":256129,"stargazers_count":1345,"watchers_count":1345,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":395,"mirror_url":null,"archived":false,"open_issues_count":581,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":395,"open_issues":581,"watchers":1345,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/10625"},"html":{"href":"https://github.com/ballerina-platform/ballerina-lang/pull/10625"},"issue":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/10625"},"comments":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/10625/comments"},"review_comments":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/10625/comments"},"review_comment":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/10625/commits"},"statuses":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/statuses/59b5b995bd28b44507bc5eee4e1a276ad46e439f"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"Kishanthan"}}