Function setmetatable

  • Sets the metatable for the given table. If metatable is nil, the metatable of the given table is removed. If the original metatable has a "__metatable" field, this will raise an error. This function returns the table t, which was passed to the function.

    Type Parameters

    • T extends object

    Parameters

    • object: T
    • metatable: LuaMetatable<T>

    Returns T