File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1323,16 +1323,16 @@ pub const Lua = opaque {
13231323 else = > getUserValue52 ,
13241324 };
13251325
1326- /// If the value at the given index has a metatable, the function pushes that metatable onto the stack
1327- /// Otherwise an error is returned
1326+ /// If the value at the given index has a metatable, the function pushes that metatable onto the stack.
1327+ /// Otherwise ` error.NoMetatable` is returned.
13281328 ///
13291329 /// * Pops: `0`
13301330 /// * Pushes: `(0|1)`
13311331 /// * Lua Errors: `never`
13321332 ///
13331333 /// See https://www.lua.org/manual/5.4/manual.html#lua_getmetatable
1334- pub fn getMetatable (lua : * Lua , index : i32 ) ! void {
1335- if (c .lua_getmetatable (@ptrCast (lua ), index ) == 0 ) return error .LuaError ;
1334+ pub fn getMetatable (lua : * Lua , index : i32 ) error { NoMetatable } ! void {
1335+ if (c .lua_getmetatable (@ptrCast (lua ), index ) == 0 ) return error .NoMetatable ;
13361336 }
13371337
13381338 /// Pushes onto the stack the value `t[k]`, where `t` is the value at the given `index` and `k` is the value on the top of the stack.
Original file line number Diff line number Diff line change @@ -788,7 +788,7 @@ test "table access" {
788788 _ = lua .pushStringZ ("zig" );
789789 lua .rawSetTable (1 );
790790
791- try expectError (error .LuaError , lua .getMetatable (1 ));
791+ try expectError (error .NoMetatable , lua .getMetatable (1 ));
792792
793793 // create a metatable (it isn't a useful one)
794794 lua .newTable ();
You can’t perform that action at this time.
0 commit comments