aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2025-04-08 11:37:42 +0100
committergingerBill <bill@gingerbill.org>2025-04-08 11:37:42 +0100
commitb07387321a37485b8561d743aba0dc41de462bb2 (patch)
tree4677df389ddca23485b0e9580b31818d309ec181 /src/check_type.cpp
parentfe040d1bbd22c78081ffc1d45b3462f40f8eb17a (diff)
parent329b15961ab95ae2f9fb54e8eb15322089f81a61 (diff)
Merge branch 'master' of https://github.com/odin-lang/Odin
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;