{"action":"created","comment":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/pulls/comments/58863468","id":58863468,"diff_hunk":"@@ -4277,7 +4277,20 @@ let get_main ctx =\n \t\t\t\tNot_found -> error (\"Invalid -main : \" ^ s_type_path cl ^ \" does not have static function main\") c.cl_pos\n \t\t) in\n \t\tlet emain = type_type ctx cl null_pos in\n-\t\tSome (mk (TCall (mk (TField (emain,fmode)) ft null_pos,[])) r null_pos)\n+\t\tlet main = mk (TCall (mk (TField (emain,fmode)) ft null_pos,[])) r null_pos in\n+\t\t(* add haxe.EntryPoint.run() call *)\n+\t\tlet main = (try\n+\t\t\tlet et = List.find (fun t -> t_path t = ([\"haxe\"],\"EntryPoint\")) types in\n+\t\t\tlet ec = (match et with TClassDecl c -> c | _ -> assert false) in\n+\t\t\tlet ef = PMap.find \"run\" ec.cl_statics in\n+\t\t\tlet p = null_pos in\n+\t\t\tlet et = mk (TTypeExpr et) (TAnon { a_fields = PMap.empty; a_status = ref (Statics ec) }) p in\n+\t\t\tlet call = mk (TCall (mk (TField (et,FStatic (ec,ef))) ef.cf_type p,[])) ctx.t.tvoid p in\n+\t\t\tmk (TBlock [main;call]) ctx.t.tvoid p\n+\t\twith Not_found ->\n+\t\t\tmain\n+\t\t) in\n+\t\tSome main","path":"src/typing/typer.ml","position":27,"original_position":27,"commit_id":"77fda7e2243875d4b933d2f16252ecc5916b1b7a","original_commit_id":"77fda7e2243875d4b933d2f16252ecc5916b1b7a","user":{"login":"Simn","id":634365,"avatar_url":"https://avatars.githubusercontent.com/u/634365?v=3","gravatar_id":"","url":"https://api.github.com/users/Simn","html_url":"https://github.com/Simn","followers_url":"https://api.github.com/users/Simn/followers","following_url":"https://api.github.com/users/Simn/following{/other_user}","gists_url":"https://api.github.com/users/Simn/gists{/gist_id}","starred_url":"https://api.github.com/users/Simn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Simn/subscriptions","organizations_url":"https://api.github.com/users/Simn/orgs","repos_url":"https://api.github.com/users/Simn/repos","events_url":"https://api.github.com/users/Simn/events{/privacy}","received_events_url":"https://api.github.com/users/Simn/received_events","type":"User","site_admin":false},"body":"Sorry for shaking things up again but I really don't like this. Making this depend on DCE is way too implicit and leads to confusing behavior when switching it on and off. I think this whole thing should be opt-in for the user/framework, no implicitly added by the compiler depending the other compilation parameters.","created_at":"2016-04-07T12:38:14Z","updated_at":"2016-04-07T12:38:14Z","html_url":"https://github.com/HaxeFoundation/haxe/pull/5017#discussion_r58863468","pull_request_url":"https://api.github.com/repos/HaxeFoundation/haxe/pulls/5017","_links":{"self":{"href":"https://api.github.com/repos/HaxeFoundation/haxe/pulls/comments/58863468"},"html":{"href":"https://github.com/HaxeFoundation/haxe/pull/5017#discussion_r58863468"},"pull_request":{"href":"https://api.github.com/repos/HaxeFoundation/haxe/pulls/5017"}}},"pull_request":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/pulls/5017","id":65047228,"html_url":"https://github.com/HaxeFoundation/haxe/pull/5017","diff_url":"https://github.com/HaxeFoundation/haxe/pull/5017.diff","patch_url":"https://github.com/HaxeFoundation/haxe/pull/5017.patch","issue_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/5017","number":5017,"state":"open","locked":false,"title":"Added EntryPoint/MainLoop support (close #3075)","user":{"login":"ncannasse","id":1022912,"avatar_url":"https://avatars.githubusercontent.com/u/1022912?v=3","gravatar_id":"","url":"https://api.github.com/users/ncannasse","html_url":"https://github.com/ncannasse","followers_url":"https://api.github.com/users/ncannasse/followers","following_url":"https://api.github.com/users/ncannasse/following{/other_user}","gists_url":"https://api.github.com/users/ncannasse/gists{/gist_id}","starred_url":"https://api.github.com/users/ncannasse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncannasse/subscriptions","organizations_url":"https://api.github.com/users/ncannasse/orgs","repos_url":"https://api.github.com/users/ncannasse/repos","events_url":"https://api.github.com/users/ncannasse/events{/privacy}","received_events_url":"https://api.github.com/users/ncannasse/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-02T19:14:41Z","updated_at":"2016-04-07T12:38:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"995635e121b6ccf6dc5f60e65485e8b681685e1f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/HaxeFoundation/haxe/pulls/5017/commits","review_comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/pulls/5017/comments","review_comment_url":"https://api.github.com/repos/HaxeFoundation/haxe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/5017/comments","statuses_url":"https://api.github.com/repos/HaxeFoundation/haxe/statuses/77fda7e2243875d4b933d2f16252ecc5916b1b7a","head":{"label":"HaxeFoundation:std_main_loop","ref":"std_main_loop","sha":"77fda7e2243875d4b933d2f16252ecc5916b1b7a","user":{"login":"HaxeFoundation","id":3826779,"avatar_url":"https://avatars.githubusercontent.com/u/3826779?v=3","gravatar_id":"","url":"https://api.github.com/users/HaxeFoundation","html_url":"https://github.com/HaxeFoundation","followers_url":"https://api.github.com/users/HaxeFoundation/followers","following_url":"https://api.github.com/users/HaxeFoundation/following{/other_user}","gists_url":"https://api.github.com/users/HaxeFoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/HaxeFoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaxeFoundation/subscriptions","organizations_url":"https://api.github.com/users/HaxeFoundation/orgs","repos_url":"https://api.github.com/users/HaxeFoundation/repos","events_url":"https://api.github.com/users/HaxeFoundation/events{/privacy}","received_events_url":"https://api.github.com/users/HaxeFoundation/received_events","type":"Organization","site_admin":false},"repo":{"id":10282042,"name":"haxe","full_name":"HaxeFoundation/haxe","owner":{"login":"HaxeFoundation","id":3826779,"avatar_url":"https://avatars.githubusercontent.com/u/3826779?v=3","gravatar_id":"","url":"https://api.github.com/users/HaxeFoundation","html_url":"https://github.com/HaxeFoundation","followers_url":"https://api.github.com/users/HaxeFoundation/followers","following_url":"https://api.github.com/users/HaxeFoundation/following{/other_user}","gists_url":"https://api.github.com/users/HaxeFoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/HaxeFoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaxeFoundation/subscriptions","organizations_url":"https://api.github.com/users/HaxeFoundation/orgs","repos_url":"https://api.github.com/users/HaxeFoundation/repos","events_url":"https://api.github.com/users/HaxeFoundation/events{/privacy}","received_events_url":"https://api.github.com/users/HaxeFoundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HaxeFoundation/haxe","description":"Haxe - The Cross-Platform Toolkit","fork":false,"url":"https://api.github.com/repos/HaxeFoundation/haxe","forks_url":"https://api.github.com/repos/HaxeFoundation/haxe/forks","keys_url":"https://api.github.com/repos/HaxeFoundation/haxe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HaxeFoundation/haxe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HaxeFoundation/haxe/teams","hooks_url":"https://api.github.com/repos/HaxeFoundation/haxe/hooks","issue_events_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/events{/number}","events_url":"https://api.github.com/repos/HaxeFoundation/haxe/events","assignees_url":"https://api.github.com/repos/HaxeFoundation/haxe/assignees{/user}","branches_url":"https://api.github.com/repos/HaxeFoundation/haxe/branches{/branch}","tags_url":"https://api.github.com/repos/HaxeFoundation/haxe/tags","blobs_url":"https://api.github.com/repos/HaxeFoundation/haxe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HaxeFoundation/haxe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HaxeFoundation/haxe/git/refs{/sha}","trees_url":"https://api.github.com/repos/HaxeFoundation/haxe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HaxeFoundation/haxe/statuses/{sha}","languages_url":"https://api.github.com/repos/HaxeFoundation/haxe/languages","stargazers_url":"https://api.github.com/repos/HaxeFoundation/haxe/stargazers","contributors_url":"https://api.github.com/repos/HaxeFoundation/haxe/contributors","subscribers_url":"https://api.github.com/repos/HaxeFoundation/haxe/subscribers","subscription_url":"https://api.github.com/repos/HaxeFoundation/haxe/subscription","commits_url":"https://api.github.com/repos/HaxeFoundation/haxe/commits{/sha}","git_commits_url":"https://api.github.com/repos/HaxeFoundation/haxe/git/commits{/sha}","comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/comments{/number}","issue_comment_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/comments{/number}","contents_url":"https://api.github.com/repos/HaxeFoundation/haxe/contents/{+path}","compare_url":"https://api.github.com/repos/HaxeFoundation/haxe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HaxeFoundation/haxe/merges","archive_url":"https://api.github.com/repos/HaxeFoundation/haxe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HaxeFoundation/haxe/downloads","issues_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues{/number}","pulls_url":"https://api.github.com/repos/HaxeFoundation/haxe/pulls{/number}","milestones_url":"https://api.github.com/repos/HaxeFoundation/haxe/milestones{/number}","notifications_url":"https://api.github.com/repos/HaxeFoundation/haxe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/labels{/name}","releases_url":"https://api.github.com/repos/HaxeFoundation/haxe/releases{/id}","deployments_url":"https://api.github.com/repos/HaxeFoundation/haxe/deployments","created_at":"2013-05-25T09:20:11Z","updated_at":"2016-04-07T06:43:58Z","pushed_at":"2016-04-07T12:15:55Z","git_url":"git://github.com/HaxeFoundation/haxe.git","ssh_url":"git@github.com:HaxeFoundation/haxe.git","clone_url":"https://github.com/HaxeFoundation/haxe.git","svn_url":"https://github.com/HaxeFoundation/haxe","homepage":"http://haxe.org","size":86865,"stargazers_count":1352,"watchers_count":1352,"language":"Haxe","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":283,"mirror_url":null,"open_issues_count":382,"forks":283,"open_issues":382,"watchers":1352,"default_branch":"development"}},"base":{"label":"HaxeFoundation:development","ref":"development","sha":"e5368042e6805cacd83de40b878b51bff29a7564","user":{"login":"HaxeFoundation","id":3826779,"avatar_url":"https://avatars.githubusercontent.com/u/3826779?v=3","gravatar_id":"","url":"https://api.github.com/users/HaxeFoundation","html_url":"https://github.com/HaxeFoundation","followers_url":"https://api.github.com/users/HaxeFoundation/followers","following_url":"https://api.github.com/users/HaxeFoundation/following{/other_user}","gists_url":"https://api.github.com/users/HaxeFoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/HaxeFoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaxeFoundation/subscriptions","organizations_url":"https://api.github.com/users/HaxeFoundation/orgs","repos_url":"https://api.github.com/users/HaxeFoundation/repos","events_url":"https://api.github.com/users/HaxeFoundation/events{/privacy}","received_events_url":"https://api.github.com/users/HaxeFoundation/received_events","type":"Organization","site_admin":false},"repo":{"id":10282042,"name":"haxe","full_name":"HaxeFoundation/haxe","owner":{"login":"HaxeFoundation","id":3826779,"avatar_url":"https://avatars.githubusercontent.com/u/3826779?v=3","gravatar_id":"","url":"https://api.github.com/users/HaxeFoundation","html_url":"https://github.com/HaxeFoundation","followers_url":"https://api.github.com/users/HaxeFoundation/followers","following_url":"https://api.github.com/users/HaxeFoundation/following{/other_user}","gists_url":"https://api.github.com/users/HaxeFoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/HaxeFoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaxeFoundation/subscriptions","organizations_url":"https://api.github.com/users/HaxeFoundation/orgs","repos_url":"https://api.github.com/users/HaxeFoundation/repos","events_url":"https://api.github.com/users/HaxeFoundation/events{/privacy}","received_events_url":"https://api.github.com/users/HaxeFoundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HaxeFoundation/haxe","description":"Haxe - The Cross-Platform Toolkit","fork":false,"url":"https://api.github.com/repos/HaxeFoundation/haxe","forks_url":"https://api.github.com/repos/HaxeFoundation/haxe/forks","keys_url":"https://api.github.com/repos/HaxeFoundation/haxe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HaxeFoundation/haxe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HaxeFoundation/haxe/teams","hooks_url":"https://api.github.com/repos/HaxeFoundation/haxe/hooks","issue_events_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/events{/number}","events_url":"https://api.github.com/repos/HaxeFoundation/haxe/events","assignees_url":"https://api.github.com/repos/HaxeFoundation/haxe/assignees{/user}","branches_url":"https://api.github.com/repos/HaxeFoundation/haxe/branches{/branch}","tags_url":"https://api.github.com/repos/HaxeFoundation/haxe/tags","blobs_url":"https://api.github.com/repos/HaxeFoundation/haxe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HaxeFoundation/haxe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HaxeFoundation/haxe/git/refs{/sha}","trees_url":"https://api.github.com/repos/HaxeFoundation/haxe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HaxeFoundation/haxe/statuses/{sha}","languages_url":"https://api.github.com/repos/HaxeFoundation/haxe/languages","stargazers_url":"https://api.github.com/repos/HaxeFoundation/haxe/stargazers","contributors_url":"https://api.github.com/repos/HaxeFoundation/haxe/contributors","subscribers_url":"https://api.github.com/repos/HaxeFoundation/haxe/subscribers","subscription_url":"https://api.github.com/repos/HaxeFoundation/haxe/subscription","commits_url":"https://api.github.com/repos/HaxeFoundation/haxe/commits{/sha}","git_commits_url":"https://api.github.com/repos/HaxeFoundation/haxe/git/commits{/sha}","comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/comments{/number}","issue_comment_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/comments{/number}","contents_url":"https://api.github.com/repos/HaxeFoundation/haxe/contents/{+path}","compare_url":"https://api.github.com/repos/HaxeFoundation/haxe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HaxeFoundation/haxe/merges","archive_url":"https://api.github.com/repos/HaxeFoundation/haxe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HaxeFoundation/haxe/downloads","issues_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues{/number}","pulls_url":"https://api.github.com/repos/HaxeFoundation/haxe/pulls{/number}","milestones_url":"https://api.github.com/repos/HaxeFoundation/haxe/milestones{/number}","notifications_url":"https://api.github.com/repos/HaxeFoundation/haxe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/labels{/name}","releases_url":"https://api.github.com/repos/HaxeFoundation/haxe/releases{/id}","deployments_url":"https://api.github.com/repos/HaxeFoundation/haxe/deployments","created_at":"2013-05-25T09:20:11Z","updated_at":"2016-04-07T06:43:58Z","pushed_at":"2016-04-07T12:15:55Z","git_url":"git://github.com/HaxeFoundation/haxe.git","ssh_url":"git@github.com:HaxeFoundation/haxe.git","clone_url":"https://github.com/HaxeFoundation/haxe.git","svn_url":"https://github.com/HaxeFoundation/haxe","homepage":"http://haxe.org","size":86865,"stargazers_count":1352,"watchers_count":1352,"language":"Haxe","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":283,"mirror_url":null,"open_issues_count":382,"forks":283,"open_issues":382,"watchers":1352,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/HaxeFoundation/haxe/pulls/5017"},"html":{"href":"https://github.com/HaxeFoundation/haxe/pull/5017"},"issue":{"href":"https://api.github.com/repos/HaxeFoundation/haxe/issues/5017"},"comments":{"href":"https://api.github.com/repos/HaxeFoundation/haxe/issues/5017/comments"},"review_comments":{"href":"https://api.github.com/repos/HaxeFoundation/haxe/pulls/5017/comments"},"review_comment":{"href":"https://api.github.com/repos/HaxeFoundation/haxe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HaxeFoundation/haxe/pulls/5017/commits"},"statuses":{"href":"https://api.github.com/repos/HaxeFoundation/haxe/statuses/77fda7e2243875d4b933d2f16252ecc5916b1b7a"}}}}