mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-31 20:00:09 +00:00
Fix constant procedure parameters when passing literals
This commit is contained in:
+9
-1
@@ -6473,7 +6473,14 @@ gb_internal CallArgumentError check_call_arguments_internal(CheckerContext *c, A
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (e && e->kind == Entity_Constant && is_type_proc(e->type)) {
|
if (e && e->kind == Entity_Constant && is_type_proc(e->type)) {
|
||||||
if (o->mode != Addressing_Constant) {
|
bool ok = false;
|
||||||
|
if (o->mode == Addressing_Constant) {
|
||||||
|
ok = true;
|
||||||
|
} else if (o->value.kind == ExactValue_Procedure) {
|
||||||
|
ok = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ok) {
|
||||||
if (show_error) {
|
if (show_error) {
|
||||||
error(o->expr, "Expected a constant procedure value for the argument '%.*s'", LIT(e->token.string));
|
error(o->expr, "Expected a constant procedure value for the argument '%.*s'", LIT(e->token.string));
|
||||||
}
|
}
|
||||||
@@ -11423,6 +11430,7 @@ gb_internal ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast
|
|||||||
|
|
||||||
o->mode = Addressing_Value;
|
o->mode = Addressing_Value;
|
||||||
o->type = type;
|
o->type = type;
|
||||||
|
o->value = exact_value_procedure(node);
|
||||||
case_end;
|
case_end;
|
||||||
|
|
||||||
case_ast_node(te, TernaryIfExpr, node);
|
case_ast_node(te, TernaryIfExpr, node);
|
||||||
|
|||||||
Reference in New Issue
Block a user