Begin work for bit_set[...; [N]T] (not working)

This commit is contained in:
gingerBill
2024-07-15 14:49:20 +01:00
parent 5cefab8229
commit 1e37eaf54d
9 changed files with 140 additions and 42 deletions

View File

@@ -9947,10 +9947,14 @@ gb_internal ExprKind check_compound_literal(CheckerContext *c, Operand *o, Ast *
}
Type *et = base_type(t->BitSet.elem);
isize field_count = 0;
if (et->kind == Type_Enum) {
if (et != nullptr && et->kind == Type_Enum) {
field_count = et->Enum.fields.count;
}
if (is_type_array(bit_set_to_int(t))) {
is_constant = false;
}
if (cl->elems[0]->kind == Ast_FieldValue) {
error(cl->elems[0], "'field = value' in a bit_set a literal is not allowed");
is_constant = false;