nrother / dynamiclua

Wrapper for NLua, making access to lua more idomatic from .NET. Heavily using the "dynamic" keyword.
63 stars 10 forks source link

Calling an table with a __call metamethod from C# fails #10

Open nrother opened 10 years ago

nrother commented 10 years ago

This fails:

dynamic tab = lua.NewTable("tab");
dynamic mt = lua.NewTable("mt");
mt.__call = new Func<dynamic, object>((t) => "call no args");
tab.SetMetatable(mt);
lua.tab()); //fail
System.InvalidCastException: Das Objekt des Typs "NLua.LuaTable" kann nicht in Typ "NLua.LuaFunction" umgewandelt werden.