mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-15 16:25:05 +00:00
switch @panic to roc_panic to really throw panics for bad numeric ops
This commit is contained in:
parent
737d766841
commit
23e22693d4
2 changed files with 27 additions and 11 deletions
|
@ -233,7 +233,12 @@ pub fn exportCeiling(comptime F: type, comptime T: type, comptime name: []const
|
|||
pub fn exportDivCeil(comptime T: type, comptime name: []const u8) void {
|
||||
comptime var f = struct {
|
||||
fn func(a: T, b: T) callconv(.C) T {
|
||||
return math.divCeil(T, a, b) catch @panic("TODO runtime exception for dividing by 0!");
|
||||
return math.divCeil(T, a, b) catch {
|
||||
roc_panic("integer divison by 0", 0);
|
||||
unreachable;
|
||||
};
|
||||
|
||||
// return math.divCeil(T, a, b) catch @panic("TODO runtime exception for dividing by 0!");
|
||||
}
|
||||
}.func;
|
||||
@export(f, .{ .name = name ++ @typeName(T), .linkage = .Strong });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue