All enums in array indices

This commit is contained in:
gingerBill
2018-08-17 19:38:15 +01:00
parent e326f41d16
commit ffc4f01470
2 changed files with 3 additions and 3 deletions

View File

@@ -2579,7 +2579,7 @@ bool check_index_value(CheckerContext *c, bool open_range, Ast *index_value, i64
return false;
}
if (!is_type_integer(operand.type)) {
if (!is_type_integer(operand.type) && !is_type_enum(operand.type)) {
gbString expr_str = expr_to_string(operand.expr);
error(operand.expr, "Index '%s' must be an integer", expr_str);
gb_string_free(expr_str);