mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
All enums in array indices
This commit is contained in:
@@ -429,11 +429,11 @@ reserve_dynamic_array :: proc(array: ^$T/[dynamic]$E, capacity: int, loc := #cal
|
|||||||
}
|
}
|
||||||
|
|
||||||
@(builtin)
|
@(builtin)
|
||||||
incl :: proc(s: ^$B/bit_set[$T], elem: T) {
|
incl :: inline proc(s: ^$B/bit_set[$T], elem: T) {
|
||||||
s^ |= {elem};
|
s^ |= {elem};
|
||||||
}
|
}
|
||||||
@(builtin)
|
@(builtin)
|
||||||
excl :: proc(s: ^$B/bit_set[$T], elem: T) {
|
excl :: inline proc(s: ^$B/bit_set[$T], elem: T) {
|
||||||
s^ &~= {elem};
|
s^ &~= {elem};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -2579,7 +2579,7 @@ bool check_index_value(CheckerContext *c, bool open_range, Ast *index_value, i64
|
|||||||
return false;
|
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);
|
gbString expr_str = expr_to_string(operand.expr);
|
||||||
error(operand.expr, "Index '%s' must be an integer", expr_str);
|
error(operand.expr, "Index '%s' must be an integer", expr_str);
|
||||||
gb_string_free(expr_str);
|
gb_string_free(expr_str);
|
||||||
|
|||||||
Reference in New Issue
Block a user