{"action":"created","issue":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/5243","repository_url":"https://api.github.com/repos/HaxeFoundation/haxe","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/5243/labels{/name}","comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/5243/comments","events_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/5243/events","html_url":"https://github.com/HaxeFoundation/haxe/issues/5243","id":155159237,"number":5243,"title":"[lua] function or expression too complex near ','","user":{"login":"azrafe7","id":1266447,"avatar_url":"https://avatars.githubusercontent.com/u/1266447?v=3","gravatar_id":"","url":"https://api.github.com/users/azrafe7","html_url":"https://github.com/azrafe7","followers_url":"https://api.github.com/users/azrafe7/followers","following_url":"https://api.github.com/users/azrafe7/following{/other_user}","gists_url":"https://api.github.com/users/azrafe7/gists{/gist_id}","starred_url":"https://api.github.com/users/azrafe7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azrafe7/subscriptions","organizations_url":"https://api.github.com/users/azrafe7/orgs","repos_url":"https://api.github.com/users/azrafe7/repos","events_url":"https://api.github.com/users/azrafe7/events{/privacy}","received_events_url":"https://api.github.com/users/azrafe7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-17T01:41:56Z","updated_at":"2016-05-17T01:48:30Z","closed_at":null,"body":"Having a class with more than 110 functions (inherited or not) results in the error reported in the title. Searching online on what might be the cause lead me to http://lua-users.org/lists/lua-l/2015-04/msg00376.html.\r\n\r\nTo repro (a bit convoluted maybe):\r\n\r\n`TestBigClass.hx`\r\n```haxe\r\nclass TestBigClass {\r\n\tstatic public function main() {\r\n\t\tvar bigClass = new BigClass();\r\n\t}\r\n}\r\n\r\n@:build(TypeBuildingMacro.build(120)) // add 120 dummy functions to BigClass\r\nclass BigClass {\r\n\tpublic function new() { }\r\n}\r\n```\r\n\r\n`TypeBuildingMacro.hx`\r\n```haxe\r\nimport haxe.macro.Context;\r\nimport haxe.macro.Expr;\r\n\r\nclass TypeBuildingMacro {\r\n\tmacro static public function build(count:Int):Array<Field> {\r\n\t\tvar fields = Context.getBuildFields();\r\n\t\tfor (i in 0...count) {\r\n\t\t\tvar newField = {\r\n\t\t\t\tname: \"function\" + i,\r\n\t\t\t\tdoc: null,\r\n\t\t\t\tmeta: [],\r\n\t\t\t\taccess: [APublic],\r\n\t\t\t\tkind: FFun({\r\n\t\t\t\t\targs: [],\r\n\t\t\t\t\texpr: macro null,\r\n\t\t\t\t\tret: null\r\n\t\t\t\t}),\r\n\t\t\t\tpos: Context.currentPos()\r\n\t\t\t};\r\n\t\t\tfields.push(newField);\r\n\t\t}\r\n\t\treturn fields;\r\n\t}\r\n}\r\n```\r\n\r\n(for me - on win with lua 5.2.4 - the limit is around 118 before I get an error)\r\n\r\nThis can also be reproduced by running the tests for the polygonal-ds lib (if I recall correctly)."},"comment":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/comments/219598644","html_url":"https://github.com/HaxeFoundation/haxe/issues/5243#issuecomment-219598644","issue_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/5243","id":219598644,"user":{"login":"azrafe7","id":1266447,"avatar_url":"https://avatars.githubusercontent.com/u/1266447?v=3","gravatar_id":"","url":"https://api.github.com/users/azrafe7","html_url":"https://github.com/azrafe7","followers_url":"https://api.github.com/users/azrafe7/followers","following_url":"https://api.github.com/users/azrafe7/following{/other_user}","gists_url":"https://api.github.com/users/azrafe7/gists{/gist_id}","starred_url":"https://api.github.com/users/azrafe7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azrafe7/subscriptions","organizations_url":"https://api.github.com/users/azrafe7/orgs","repos_url":"https://api.github.com/users/azrafe7/repos","events_url":"https://api.github.com/users/azrafe7/events{/privacy}","received_events_url":"https://api.github.com/users/azrafe7/received_events","type":"User","site_admin":false},"created_at":"2016-05-17T01:48:30Z","updated_at":"2016-05-17T01:48:30Z","body":"The link about lua... I meant another one but can't find it right now."}}