{"action":"created","issue":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/3524","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/3524/labels{/name}","comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/3524/comments","events_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/3524/events","html_url":"https://github.com/HaxeFoundation/haxe/issues/3524","id":46968203,"number":3524,"title":"inline recursion","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},"labels":[],"state":"open","locked":false,"assignee":{"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},"milestone":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/milestones/5","html_url":"https://github.com/HaxeFoundation/haxe/milestones/3.3","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/milestones/5/labels","id":586975,"number":5,"title":"3.3","description":"","creator":{"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},"open_issues":220,"closed_issues":72,"state":"open","created_at":"2014-03-04T14:22:27Z","updated_at":"2015-06-09T09:06:10Z","due_on":"2015-11-01T23:00:00Z","closed_at":null},"comments":15,"created_at":"2014-10-27T22:31:37Z","updated_at":"2015-06-09T09:28:17Z","closed_at":null,"body":"\r\n```\r\n\r\ntypedef List = { v : Int, next : List };\r\n\r\nclass Test {\r\n\r\n\tstatic inline function cmp(a:List,b:List) {\r\n\t\treturn a.v - b.v;\r\n\t}\r\n\r\n\tstatic function main() {\r\n\t\tvar l : List = { v : 0, next : { v : -1, next : null }};\r\n\t\thaxe.ds.ListSort.sortSingleLinked(l,function(a,b) return a.v - b.v);\r\n\t\thaxe.ds.ListSort.sortSingleLinked(l,cmp);\r\n\t\ttrace(l);\r\n\t}\r\n}\r\n```\r\n\r\nThe first ListSort will correctly inline the local function, but the `cmp` function will not be inlined, while it could/should.\r\n\r\nPS: on JS, both are not inlined while they should\r\n"},"comment":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/comments/110291522","html_url":"https://github.com/HaxeFoundation/haxe/issues/3524#issuecomment-110291522","issue_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/3524","id":110291522,"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},"created_at":"2015-06-09T09:28:17Z","updated_at":"2015-06-09T09:28:17Z","body":"So why would it be crazy to simply use the function expression (with replaced locals) if we take the \"closure\" of a static inline method? This goes very well with the general concept of inlining and solves this particular problem as a subset."}}