mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-02 11:22:19 +00:00
Update panic tags of builtins
This commit is contained in:
parent
32400e37e1
commit
4202352b19
3 changed files with 7 additions and 6 deletions
|
@ -233,7 +233,7 @@ pub const RocDec = extern struct {
|
|||
const answer = RocDec.addWithOverflow(self, other);
|
||||
|
||||
if (answer.has_overflowed) {
|
||||
roc_panic("Decimal addition overflowed!", 1);
|
||||
roc_panic("Decimal addition overflowed!", 0);
|
||||
unreachable;
|
||||
} else {
|
||||
return answer.value;
|
||||
|
@ -265,7 +265,7 @@ pub const RocDec = extern struct {
|
|||
const answer = RocDec.subWithOverflow(self, other);
|
||||
|
||||
if (answer.has_overflowed) {
|
||||
roc_panic("Decimal subtraction overflowed!", 1);
|
||||
roc_panic("Decimal subtraction overflowed!", 0);
|
||||
unreachable;
|
||||
} else {
|
||||
return answer.value;
|
||||
|
@ -329,7 +329,7 @@ pub const RocDec = extern struct {
|
|||
const answer = RocDec.mulWithOverflow(self, other);
|
||||
|
||||
if (answer.has_overflowed) {
|
||||
roc_panic("Decimal multiplication overflowed!", 1);
|
||||
roc_panic("Decimal multiplication overflowed!", 0);
|
||||
unreachable;
|
||||
} else {
|
||||
return answer.value;
|
||||
|
|
|
@ -284,7 +284,7 @@ pub fn exportAddOrPanic(comptime T: type, comptime name: []const u8) void {
|
|||
fn func(self: T, other: T) callconv(.C) T {
|
||||
const result = addWithOverflow(T, self, other);
|
||||
if (result.has_overflowed) {
|
||||
roc_panic("integer addition overflowed!", 1);
|
||||
roc_panic("integer addition overflowed!", 0);
|
||||
unreachable;
|
||||
} else {
|
||||
return result.value;
|
||||
|
@ -343,7 +343,7 @@ pub fn exportSubOrPanic(comptime T: type, comptime name: []const u8) void {
|
|||
fn func(self: T, other: T) callconv(.C) T {
|
||||
const result = subWithOverflow(T, self, other);
|
||||
if (result.has_overflowed) {
|
||||
roc_panic("integer subtraction overflowed!", 1);
|
||||
roc_panic("integer subtraction overflowed!", 0);
|
||||
unreachable;
|
||||
} else {
|
||||
return result.value;
|
||||
|
@ -451,7 +451,7 @@ pub fn exportMulOrPanic(comptime T: type, comptime W: type, comptime name: []con
|
|||
fn func(self: T, other: T) callconv(.C) T {
|
||||
const result = @call(.{ .modifier = always_inline }, mulWithOverflow, .{ T, W, self, other });
|
||||
if (result.has_overflowed) {
|
||||
roc_panic("integer multiplication overflowed!", 1);
|
||||
roc_panic("integer multiplication overflowed!", 0);
|
||||
unreachable;
|
||||
} else {
|
||||
return result.value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue