aboutsummaryrefslogtreecommitdiff
path: root/src/check_builtin.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2026-01-27 09:44:52 +0000
committergingerBill <gingerBill@users.noreply.github.com>2026-01-27 09:44:52 +0000
commit92bef4578100e1bd4ca2e2ab9479216d8efcf2d3 (patch)
treef4f7aa7ba312b3c51148ba231d3f7b446ebd8d5e /src/check_builtin.cpp
parent291e5ea219df200f1345cdd9989c708d8ad7816e (diff)
Fix #6183
Diffstat (limited to 'src/check_builtin.cpp')
-rw-r--r--src/check_builtin.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp
index 929891826..e732d8ec3 100644
--- a/src/check_builtin.cpp
+++ b/src/check_builtin.cpp
@@ -5383,6 +5383,14 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
return false;
}
}
+ if (!are_types_identical(x.type, y.type)) {
+ gbString xts = type_to_string(x.type);
+ gbString yts = type_to_string(y.type);
+ error(x.expr, "Mismatched types for '%.*s', got %s vs %s", LIT(builtin_name), xts, yts);
+ gb_string_free(yts);
+ gb_string_free(xts);
+ return false;
+ }
operand->mode = Addressing_Value;
operand->type = make_optional_ok_type(default_type(x.type));
@@ -5426,6 +5434,14 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
return false;
}
}
+ if (!are_types_identical(x.type, y.type)) {
+ gbString xts = type_to_string(x.type);
+ gbString yts = type_to_string(y.type);
+ error(x.expr, "Mismatched types for '%.*s', got %s vs %s", LIT(builtin_name), xts, yts);
+ gb_string_free(yts);
+ gb_string_free(xts);
+ return false;
+ }
operand->mode = Addressing_Value;
operand->type = default_type(x.type);