mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
skip errors on polymorphic procs when in a proc group with other options
This commit is contained in:
@@ -7126,6 +7126,7 @@ gb_internal CallArgumentData check_call_arguments_proc_group(CheckerContext *c,
|
|||||||
gbString expr_name = expr_to_string(operand->expr);
|
gbString expr_name = expr_to_string(operand->expr);
|
||||||
defer (gb_string_free(expr_name));
|
defer (gb_string_free(expr_name));
|
||||||
|
|
||||||
|
c->in_proc_group = true;
|
||||||
for_array(i, procs) {
|
for_array(i, procs) {
|
||||||
Entity *p = procs[i];
|
Entity *p = procs[i];
|
||||||
if (p->flags & EntityFlag_Disabled) {
|
if (p->flags & EntityFlag_Disabled) {
|
||||||
@@ -7168,6 +7169,7 @@ gb_internal CallArgumentData check_call_arguments_proc_group(CheckerContext *c,
|
|||||||
array_add(&valids, item);
|
array_add(&valids, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
c->in_proc_group = false;
|
||||||
|
|
||||||
if (max_matched_features > 0) {
|
if (max_matched_features > 0) {
|
||||||
for_array(i, valids) {
|
for_array(i, valids) {
|
||||||
|
|||||||
+3
-1
@@ -2085,7 +2085,9 @@ gb_internal Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_para
|
|||||||
if (op.mode == Addressing_Constant) {
|
if (op.mode == Addressing_Constant) {
|
||||||
poly_const = op.value;
|
poly_const = op.value;
|
||||||
} else {
|
} 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;
|
success = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -563,6 +563,7 @@ struct CheckerContext {
|
|||||||
|
|
||||||
u32 stmt_flags;
|
u32 stmt_flags;
|
||||||
bool in_enum_type;
|
bool in_enum_type;
|
||||||
|
bool in_proc_group;
|
||||||
bool collect_delayed_decls;
|
bool collect_delayed_decls;
|
||||||
bool allow_polymorphic_types;
|
bool allow_polymorphic_types;
|
||||||
bool disallow_polymorphic_return_types; // NOTE(zen3ger): no poly type decl in return types
|
bool disallow_polymorphic_return_types; // NOTE(zen3ger): no poly type decl in return types
|
||||||
|
|||||||
Reference in New Issue
Block a user