Update panic tags of builtins

This commit is contained in:
Ayaz Hafiz 2022-11-22 17:20:17 -06:00
parent 32400e37e1
commit 4202352b19
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
3 changed files with 7 additions and 6 deletions

View file

@ -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;

View file

@ -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;