The Len metamethod does not return the value its given by the context return value.
[Metamethods.Len] = new LuaFunction(Metamethods.Index, (context, _) =>
{
var userData = context.GetArgument<LuaVariable>(0);
return new ValueTask<int>(context.Return(userData.count));
})
At the point of call, userData.count was 3.
When printing out the result to the console from within the lua state, nil is printed however.
The
Lenmetamethod does not return the value its given by the context return value.At the point of call,
userData.countwas3.When printing out the result to the console from within the lua state,
nilis printed however.