aboutsummaryrefslogtreecommitdiff
path: root/src/value.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/value.zig')
-rw-r--r--src/value.zig12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/value.zig b/src/value.zig
index faf4f38e80..df1531533b 100644
--- a/src/value.zig
+++ b/src/value.zig
@@ -2275,6 +2275,10 @@ pub const Value = extern union {
) !Value {
if (lhs.isUndef() or rhs.isUndef()) return Value.initTag(.undef);
+ if (ty.zigTypeTag() == .ComptimeInt) {
+ return intAdd(lhs, rhs, arena);
+ }
+
if (ty.isAnyFloat()) {
return floatAdd(lhs, rhs, ty, arena);
}
@@ -2361,6 +2365,10 @@ pub const Value = extern union {
) !Value {
if (lhs.isUndef() or rhs.isUndef()) return Value.initTag(.undef);
+ if (ty.zigTypeTag() == .ComptimeInt) {
+ return intSub(lhs, rhs, arena);
+ }
+
if (ty.isAnyFloat()) {
return floatSub(lhs, rhs, ty, arena);
}
@@ -2440,6 +2448,10 @@ pub const Value = extern union {
) !Value {
if (lhs.isUndef() or rhs.isUndef()) return Value.initTag(.undef);
+ if (ty.zigTypeTag() == .ComptimeInt) {
+ return intMul(lhs, rhs, arena);
+ }
+
if (ty.isAnyFloat()) {
return floatMul(lhs, rhs, ty, arena);
}