{"action":"created","issue":{"url":"https://api.github.com/repos/jeremyong/Selene/issues/140","repository_url":"https://api.github.com/repos/jeremyong/Selene","labels_url":"https://api.github.com/repos/jeremyong/Selene/issues/140/labels{/name}","comments_url":"https://api.github.com/repos/jeremyong/Selene/issues/140/comments","events_url":"https://api.github.com/repos/jeremyong/Selene/issues/140/events","html_url":"https://github.com/jeremyong/Selene/issues/140","id":122037577,"number":140,"title":"not work when more than one userdef data in one lua function","user":{"login":"lucklove","id":8718109,"avatar_url":"https://avatars.githubusercontent.com/u/8718109?v=3","gravatar_id":"","url":"https://api.github.com/users/lucklove","html_url":"https://github.com/lucklove","followers_url":"https://api.github.com/users/lucklove/followers","following_url":"https://api.github.com/users/lucklove/following{/other_user}","gists_url":"https://api.github.com/users/lucklove/gists{/gist_id}","starred_url":"https://api.github.com/users/lucklove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucklove/subscriptions","organizations_url":"https://api.github.com/users/lucklove/orgs","repos_url":"https://api.github.com/users/lucklove/repos","events_url":"https://api.github.com/users/lucklove/events{/privacy}","received_events_url":"https://api.github.com/users/lucklove/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-12-14T12:59:17Z","updated_at":"2016-02-11T01:41:18Z","closed_at":null,"body":"For example. this not work：\r\n```\r\nstruct X\r\n{\r\n    int x;\r\n};\r\n\r\nstruct Y\r\n{\r\n    int y;\r\n};\r\n\r\nbool test_param_order(sel::State &state) {\r\n    state[\"X\"].SetClass<X>(\"x\", &X::x);\r\n    state[\"Y\"].SetClass<Y>(\"y\", &Y::y);\r\n    X x{1};\r\n    Y y{2};\r\n    state(R\"(\r\n        function exchange_value(x, y)\r\n            local tmp = x:x()\r\n            x.set_x(y:y())\r\n            y.set_y(tmp)\r\n        end\r\n    )\");\r\n    state[\"exchange_value\"](x, y); \r\n    return x.x == 2 && y.y == 1;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/jeremyong/Selene/issues/comments/182669411","html_url":"https://github.com/jeremyong/Selene/issues/140#issuecomment-182669411","issue_url":"https://api.github.com/repos/jeremyong/Selene/issues/140","id":182669411,"user":{"login":"lucklove","id":8718109,"avatar_url":"https://avatars.githubusercontent.com/u/8718109?v=3","gravatar_id":"","url":"https://api.github.com/users/lucklove","html_url":"https://github.com/lucklove","followers_url":"https://api.github.com/users/lucklove/followers","following_url":"https://api.github.com/users/lucklove/following{/other_user}","gists_url":"https://api.github.com/users/lucklove/gists{/gist_id}","starred_url":"https://api.github.com/users/lucklove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucklove/subscriptions","organizations_url":"https://api.github.com/users/lucklove/orgs","repos_url":"https://api.github.com/users/lucklove/repos","events_url":"https://api.github.com/users/lucklove/events{/privacy}","received_events_url":"https://api.github.com/users/lucklove/received_events","type":"User","site_admin":false},"created_at":"2016-02-11T01:41:18Z","updated_at":"2016-02-11T01:41:18Z","body":"@daedric Hello, I test your code in both selene and nua, the result is that it print out\r\n```\r\nobj1\r\nobj2\r\nobj2\r\n```\r\nin selene, and print out\r\n```\r\nobj1\r\nobj1\r\nobj2\r\n```\r\nin nua.\r\nSo I think you encountered the same problem as us, and I guess the reason is also the same(the lua light userdata). So this issue is also useful for you."}}