GameCTO / luainterface

Automatically exported from code.google.com/p/luainterface
0 stars 0 forks source link

Inconsistent behavoir for wrapping functions #37

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Register a random function in Lua.
2. Recall the function by .DoString("return functionName")[0];
3. Recall a Lua function by .DoString("return print")[0];

What is the expected output? What do you see instead?
I expect to have to instances of LuaFunction. Instead I get a LuaFunction for 
the second one, but a LuaCSFunction for the first one.

Please provide any additional information below.
This it really annoying, since you could wrap the Function yourself with new 
LuaFunction(), but you need to cast the Parameter to LuaCSFunction, and this in 
defined in the C++ part, and you normally have no reference to that! You can 
work arround this by using Reflection, but thats a bit ugly.
I'm not sure how to fix this. You could check it in .DoString but that could be 
an even greater performance hit...

Original issue reported on code.google.com by i...@niklas-rother.de on 12 Jul 2011 at 3:10