diff options
| author | gingerBill <bill@gingerbill.org> | 2024-07-15 14:49:20 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-07-15 14:49:20 +0100 |
| commit | 1e37eaf54daf885636ea3ad9606a2b54e01721f9 (patch) | |
| tree | 207c49870eb711412d08394d5ee4b169797f5d73 /src/check_expr.cpp | |
| parent | 5cefab8229514c308c4676bbd86db7a8b3d2c5f5 (diff) | |
Begin work for `bit_set[...; [N]T]` (not working)
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 3fcfe29f5..01ff9da5b 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -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; |