We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8407657 commit 436ceb7Copy full SHA for 436ceb7
src/lib.zig
@@ -2599,9 +2599,11 @@ pub const Lua = opaque {
2599
///
2600
/// * Pops: `0`
2601
/// * Pushes: `0`
2602
- /// * Errors: `error.IntegerCastFailed` if `T` is an integer type and the value at index doesn't fit
+ /// * Errors: `error.Overflow` if `T` is an integer type and the value at index doesn't fit
2603
pub fn toNumeric(lua: *Lua, comptime T: type, index: i32) !T {
2604
- if (@typeInfo(T) == .int) return std.math.cast(T, try lua.toInteger(index)) orelse error.IntegerCastFailed;
+ if (@typeInfo(T) == .int) {
2605
+ return std.math.cast(T, try lua.toInteger(index)) orelse error.Overflow;
2606
+ }
2607
return @floatCast(try lua.toNumber(index));
2608
}
2609
0 commit comments