File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -2601,7 +2601,7 @@ pub const Lua = opaque {
26012601 /// * Pushes: `0`
26022602 /// * Errors: `error.IntegerCastFailed` if `T` is an integer type and the value at index doesn't fit
26032603 pub fn toNumeric (lua : * Lua , comptime T : type , index : i32 ) ! T {
2604- if (@typeInfo (T ) == .int ) return std .math .cast (try lua .toInteger (index )) orelse error .IntegerCastFailed ;
2604+ if (@typeInfo (T ) == .int ) return std .math .cast (T , try lua .toInteger (index )) orelse error .IntegerCastFailed ;
26052605 return @floatCast (try lua .toNumber (index ));
26062606 }
26072607
Original file line number Diff line number Diff line change @@ -3061,7 +3061,7 @@ test "pushNumeric and toNumeric" {
30613061 defer lua .deinit ();
30623062
30633063 const num : u32 = 100 ;
3064- lua .pushNumeric (num );
3064+ lua .pushInteger (num );
30653065 const pull = lua .toNumeric (u32 , lua .getTop ());
30663066 try std .testing .expectEqual (num , pull );
30673067}
You can’t perform that action at this time.
0 commit comments