Skip to content

Len metamethod returns nil regardless of implementation #321

@julcreutz

Description

@julcreutz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions