mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-31 10:22:08 +00:00
Change push allocator system; update core libraries
This commit is contained in:
@@ -5179,7 +5179,6 @@ bool ternary_compare_types(Type *x, Type *y) {
|
||||
return are_types_identical(x, y);
|
||||
}
|
||||
|
||||
|
||||
ExprKind check_expr_base_internal(Checker *c, Operand *o, AstNode *node, Type *type_hint) {
|
||||
ExprKind kind = Expr_Stmt;
|
||||
|
||||
@@ -5550,16 +5549,17 @@ ExprKind check_expr_base_internal(Checker *c, Operand *o, AstNode *node, Type *t
|
||||
}
|
||||
}
|
||||
|
||||
isize field_index = 0;
|
||||
bool seen_field_value = false;
|
||||
|
||||
for_array(index, cl->elems) {
|
||||
Entity *field = t->Struct.fields_in_src_order[field_index++];
|
||||
if (!all_fields_are_blank && is_blank_ident(field->token)) {
|
||||
// NOTE(bill): Ignore blank identifiers
|
||||
continue;
|
||||
}
|
||||
Entity *field = nullptr;
|
||||
AstNode *elem = cl->elems[index];
|
||||
if (elem->kind == AstNode_FieldValue) {
|
||||
error(elem, "Mixture of `field = value` and value elements in a literal is not allowed");
|
||||
seen_field_value = true;
|
||||
// error(elem, "Mixture of `field = value` and value elements in a literal is not allowed");
|
||||
// continue;
|
||||
} else if (seen_field_value) {
|
||||
error(elem, "Value elements cannot be used after a `field = value`");
|
||||
continue;
|
||||
}
|
||||
if (index >= field_count) {
|
||||
@@ -5567,6 +5567,14 @@ ExprKind check_expr_base_internal(Checker *c, Operand *o, AstNode *node, Type *t
|
||||
break;
|
||||
}
|
||||
|
||||
if (field == nullptr) {
|
||||
field = t->Struct.fields_in_src_order[index];
|
||||
}
|
||||
if (!all_fields_are_blank && is_blank_ident(field->token)) {
|
||||
// NOTE(bill): Ignore blank identifiers
|
||||
continue;
|
||||
}
|
||||
|
||||
check_expr_with_type_hint(c, o, elem, field->type);
|
||||
|
||||
if (!check_is_field_exported(c, field)) {
|
||||
|
||||
Reference in New Issue
Block a user