Skip to content

Commit d105efd

Browse files
luchaknatecraddock
authored andcommitted
Invert the argExpected condition to match Lua docs
1 parent 7479680 commit d105efd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/lib.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2382,7 +2382,7 @@ pub const Lua = opaque {
23822382
/// See https://www.lua.org/manual/5.4/manual.html#luaL_argexpected
23832383
pub fn argExpected(lua: *Lua, cond: bool, arg: i32, type_name: [:0]const u8) void {
23842384
// translate-c failed
2385-
if (cond) lua.typeError(arg, type_name);
2385+
if (!cond) lua.typeError(arg, type_name);
23862386
}
23872387

23882388
/// Calls a metamethod

src/tests.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1635,7 +1635,7 @@ test "args and errors" {
16351635

16361636
const argExpected = ziglua.wrap(struct {
16371637
fn inner(l: *Lua) i32 {
1638-
l.argExpected(true, 1, "string");
1638+
l.argExpected(false, 1, "string");
16391639
return 0;
16401640
}
16411641
}.inner);

0 commit comments

Comments
 (0)