aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2025-04-08 10:13:45 +0200
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2025-04-08 10:13:45 +0200
commiteeb8b8dcc409db59fd45ba1d736367963dcd2c56 (patch)
tree989f1434af16411d740c37aaadbae4fab3f31885 /src/check_type.cpp
parent44bd2d37504c5c67c5468a6fe761db29a2fad137 (diff)
Fix #5020
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 9d4defbb2..cd55bfdc0 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -2082,7 +2082,9 @@ gb_internal Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_para
if (type != t_invalid && !check_is_assignable_to(ctx, &op, type, allow_array_programming)) {
bool ok = true;
if (p->flags&FieldFlag_any_int) {
- if ((!is_type_integer(op.type) && !is_type_enum(op.type)) || (!is_type_integer(type) && !is_type_enum(type))) {
+ if (op.type == nullptr) {
+ ok = false;
+ } else if ((!is_type_integer(op.type) && !is_type_enum(op.type)) || (!is_type_integer(type) && !is_type_enum(type))) {
ok = false;
} else if (!check_is_castable_to(ctx, &op, type)) {
ok = false;