aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorA1029384756 <hayden.gray104@gmail.com>2025-08-28 11:30:47 -0400
committerA1029384756 <hayden.gray104@gmail.com>2025-08-28 11:30:47 -0400
commit3074146784e253bd536b494aca2d7ce987ead20d (patch)
treee6f108df76b4d2cad6dfd7fc3b458f6ad2f5a420 /src
parentf7936419cd5a022d6bb2100274832df5e7f42eee (diff)
skip errors on polymorphic procs when in a proc group with other options
Diffstat (limited to 'src')
-rw-r--r--src/check_expr.cpp2
-rw-r--r--src/check_type.cpp4
-rw-r--r--src/checker.hpp1
3 files changed, 6 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 862dd9278..80ec4f78e 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -7126,6 +7126,7 @@ gb_internal CallArgumentData check_call_arguments_proc_group(CheckerContext *c,
gbString expr_name = expr_to_string(operand->expr);
defer (gb_string_free(expr_name));
+ c->in_proc_group = true;
for_array(i, procs) {
Entity *p = procs[i];
if (p->flags & EntityFlag_Disabled) {
@@ -7168,6 +7169,7 @@ gb_internal CallArgumentData check_call_arguments_proc_group(CheckerContext *c,
array_add(&valids, item);
}
}
+ c->in_proc_group = false;
if (max_matched_features > 0) {
for_array(i, valids) {
diff --git a/src/check_type.cpp b/src/check_type.cpp
index a427a1927..a104d6fc0 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -2085,7 +2085,9 @@ gb_internal Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_para
if (op.mode == Addressing_Constant) {
poly_const = op.value;
} else {
- error(op.expr, "Expected a constant value for this polymorphic name parameter, got %s", expr_to_string(op.expr));
+ if (!ctx->in_proc_group) {
+ error(op.expr, "Expected a constant value for this polymorphic name parameter, got %s", expr_to_string(op.expr));
+ }
success = false;
}
}
diff --git a/src/checker.hpp b/src/checker.hpp
index e32250b2f..58ac8beb5 100644
--- a/src/checker.hpp
+++ b/src/checker.hpp
@@ -563,6 +563,7 @@ struct CheckerContext {
u32 stmt_flags;
bool in_enum_type;
+ bool in_proc_group;
bool collect_delayed_decls;
bool allow_polymorphic_types;
bool disallow_polymorphic_return_types; // NOTE(zen3ger): no poly type decl in return types