mirror of
https://github.com/odin-lang/Odin.git
synced 2026-10-12 11:09:25 -04:00
Disallow enumerated array literals without field = value
This commit is contained in:
1 parent
1bc6e6a7cc
commit
267ae0b4a2
1 file changed
+2
@@ -8128,6 +8128,8 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
|
||||
if (cl->elems.count > 0 && cl->elems[0]->kind != Ast_FieldValue) {
|
||||
if (0 < max && max < t->EnumeratedArray.count) {
|
||||
error(node, "Expected %lld values for this enumerated array literal, got %lld", cast(long long)t->EnumeratedArray.count, cast(long long)max);
|
||||
} else {
|
||||
error(node, "Enumerated array literals must only have 'field = value' elements, bare elements are not allowed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user