An interpreter for the Lua language, written entirely in C# for the .NET, Mono, Xamarin and Unity3D platforms, including handy remote debugger facilities.
When using automatic registration of types, the table from here isn't true for the more complex types (type/methodinfo/list/dictionary/enumerable/etc) due to ClrToScriptConversions.ObjectToDynValue using UserData.Create to check if the value is valid userdata.
The problem is that UserData.Create will (almost?) always end up auto-registering whatever type you pass and never hit the block that creates the table/dictionary/method/etc.
The fix is probably to check whether the passed object is of a registered type first:
If it is, create the userdata and return it.
If it isn't, check it against the hardcoded CLR conversions (except maybe Enum -> integer, I'd expect that one to never hit if auto registration is on) and then try to create userdata.
When using automatic registration of types, the table from here isn't true for the more complex types (type/methodinfo/list/dictionary/enumerable/etc) due to
ClrToScriptConversions.ObjectToDynValue
usingUserData.Create
to check if the value is valid userdata.The problem is that
UserData.Create
will (almost?) always end up auto-registering whatever type you pass and never hit the block that creates the table/dictionary/method/etc.The fix is probably to check whether the passed object is of a registered type first: