-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Milestone
Description
If a method defined on a class is called from within Lua, it is boxed, converted, then converted back and unboxed. It would be better to detect that the method is defined in Lua and call it directly to avoid the extra boxing and conversions.
Example:
interface ITest {
int Do();
}class Test : ITest
function Test::Do()
return 12
end
local obj = Test()
local x = obj:Do()In this example, the call to Do will first return the 12 as a double in a multi-value. Then it is converted to an integer in a wrapper function for the C# interface. Then it is boxed and converted back to a double to store in the variable x.