{"action":"closed","issue":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/2216","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/2216/labels{/name}","comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/2216/comments","events_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/2216/events","html_url":"https://github.com/HaxeFoundation/haxe/issues/2216","id":20354506,"number":2216,"title":"Inlining not working as expected (Js target).","user":{"login":"sledorze","id":416760,"avatar_url":"https://avatars.githubusercontent.com/u/416760?v=3","gravatar_id":"","url":"https://api.github.com/users/sledorze","html_url":"https://github.com/sledorze","followers_url":"https://api.github.com/users/sledorze/followers","following_url":"https://api.github.com/users/sledorze/following{/other_user}","gists_url":"https://api.github.com/users/sledorze/gists{/gist_id}","starred_url":"https://api.github.com/users/sledorze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sledorze/subscriptions","organizations_url":"https://api.github.com/users/sledorze/orgs","repos_url":"https://api.github.com/users/sledorze/repos","events_url":"https://api.github.com/users/sledorze/events{/privacy}","received_events_url":"https://api.github.com/users/sledorze/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/HaxeFoundation/haxe/labels/feature-inline","name":"feature-inline","color":"bfd4f2"}],"state":"closed","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/1","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/milestones/1/labels","id":343008,"number":1,"title":"3.2","description":"","creator":{"login":"issuesbot","id":4543331,"avatar_url":"https://avatars.githubusercontent.com/u/4543331?v=3","gravatar_id":"","url":"https://api.github.com/users/issuesbot","html_url":"https://github.com/issuesbot","followers_url":"https://api.github.com/users/issuesbot/followers","following_url":"https://api.github.com/users/issuesbot/following{/other_user}","gists_url":"https://api.github.com/users/issuesbot/gists{/gist_id}","starred_url":"https://api.github.com/users/issuesbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/issuesbot/subscriptions","organizations_url":"https://api.github.com/users/issuesbot/orgs","repos_url":"https://api.github.com/users/issuesbot/repos","events_url":"https://api.github.com/users/issuesbot/events{/privacy}","received_events_url":"https://api.github.com/users/issuesbot/received_events","type":"User","site_admin":false},"open_issues":121,"closed_issues":370,"state":"open","created_at":"2013-05-28T03:42:24Z","updated_at":"2015-02-19T21:59:24Z","due_on":"2015-03-14T23:00:00Z","closed_at":null},"comments":9,"created_at":"2013-10-01T19:54:07Z","updated_at":"2015-02-19T21:59:24Z","closed_at":"2015-02-19T21:59:24Z","body":"The Js target has made a lot of progress, however, Inlining seems to still not occur as much as expected.\r\n\r\nParticularly some restriction prevent writing highly performant libraries using combinators (functional style).\r\nI have seen this issue recently with Monax and Parsex.\r\n\r\nHere's a shrinked example code not inlining as expected:\r\n\r\n```C#\r\n\tstatic inline function foo(a : Option<Int>) {\r\n\t\treturn switch (a) {\r\n\t\t\tcase Some(x): null;\r\n\t\t\tcase None: null;\r\n\t\t}\r\n\t}\r\n\r\n    static function main() {\r\n        var x = foo(Some(5)); // Not inlined\r\n        ...\r\n    }\r\n```\r\ngenerating:\r\n\r\n```javascript\r\nMain.foo = function(a) {\r\n\tswitch(a[1]) {\r\n\tcase 0:\r\n\t\tvar x = a[2];\r\n\t\treturn null;\r\n\tcase 1:\r\n\t\treturn null;\r\n\t}\r\n}\r\nMain.main = function() {\r\n\tvar x = Main.foo(haxe.ds.Option.Some(5));\r\n        ...\r\n}\r\n```\r\n\r\nWhereas this one works :\r\n\r\n```C#\r\n\tstatic inline function foo(a : Int) {\r\n\t\treturn switch (a) {\r\n\t\t\tcase 0: 1;\r\n\t\t\tdefault: 0;\r\n\t\t}\r\n\t}\r\n\r\n    static function main() {\r\n        var x = foo(5); // inlined\r\n        ...\r\n    }\r\n```\r\n\r\nIs it possible to allow inlining in those slightly more complex cases?\r\n(This was installed using 'brew install haxe --HEAD' today (3.1.0))\r\n\r\n<!---\r\n@huboard:{\"order\":2264.962890625}\r\n-->\r\n"}}