mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Change tag checking order
This commit is contained in:
+5
-20
@@ -4988,6 +4988,11 @@ ExprKind check_expr_base_internal(Checker *c, Operand *o, AstNode *node, Type *t
|
|||||||
decl->proc_lit = pl->type;
|
decl->proc_lit = pl->type;
|
||||||
c->context.decl = decl;
|
c->context.decl = decl;
|
||||||
|
|
||||||
|
if (pl->tags != 0) {
|
||||||
|
error_node(node, "A procedure literal cannot have tags");
|
||||||
|
pl->tags = 0; // TODO(bill): Should I zero this?!
|
||||||
|
}
|
||||||
|
|
||||||
check_procedure_type(c, type, pl->type);
|
check_procedure_type(c, type, pl->type);
|
||||||
if (!is_type_proc(type)) {
|
if (!is_type_proc(type)) {
|
||||||
gbString str = expr_to_string(node);
|
gbString str = expr_to_string(node);
|
||||||
@@ -4996,11 +5001,6 @@ ExprKind check_expr_base_internal(Checker *c, Operand *o, AstNode *node, Type *t
|
|||||||
check_close_scope(c);
|
check_close_scope(c);
|
||||||
return kind;
|
return kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pl->tags != 0) {
|
|
||||||
error_node(node, "A procedure literal cannot have tags");
|
|
||||||
pl->tags = 0; // TODO(bill): Should I zero this?!
|
|
||||||
}
|
|
||||||
check_procedure_later(c, c->curr_ast_file, empty_token, decl, type, pl->body, pl->tags);
|
check_procedure_later(c, c->curr_ast_file, empty_token, decl, type, pl->body, pl->tags);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5008,21 +5008,6 @@ ExprKind check_expr_base_internal(Checker *c, Operand *o, AstNode *node, Type *t
|
|||||||
|
|
||||||
c->context = prev_context;
|
c->context = prev_context;
|
||||||
|
|
||||||
|
|
||||||
// Type *type = check_type(c, pl->type);
|
|
||||||
// if (type == NULL || !is_type_proc(type)) {
|
|
||||||
// gbString str = expr_to_string(node);
|
|
||||||
// error_node(node, "Invalid procedure literal `%s`", str);
|
|
||||||
// gb_string_free(str);
|
|
||||||
// check_close_scope(c);
|
|
||||||
// return kind;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// GB_ASSERT(c->context.scope->is_proc);
|
|
||||||
// check_procedure_later(c, c->curr_ast_file, empty_token, c->context.decl, type, pl->body, pl->tags);
|
|
||||||
// check_proc_body(c, empty_token, c->context.decl, type, pl->body);
|
|
||||||
// check_close_scope(c);
|
|
||||||
|
|
||||||
o->mode = Addressing_Value;
|
o->mode = Addressing_Value;
|
||||||
o->type = type;
|
o->type = type;
|
||||||
case_end;
|
case_end;
|
||||||
|
|||||||
Reference in New Issue
Block a user