-
Notifications
You must be signed in to change notification settings - Fork 11
Using a table as __index in metatable does not work #7
Open
Labels
Description
Lua allows the metatables __index entry to be a table (and not only a function). In this case the value from the __index table is returned, if found. See http://www.lua.org/pil/13.4.1.html
With this contruct a request to any table entry from C# fails. Proof:
dynamic mt = lua.NewTable("mt"); mt.__index = lua("return { a = 5 }"); dynamic tab = lua.NewTable("tab"); tab.a = 4; tab.SetMetatable(mt); Console.WriteLine(tab.a); //crash