mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-17 19:32:23 -07:00
Fix for x in y where y is an "optional ok" value, but ignores #optional_allocator_error values
This commit is contained in:
+5
-1
@@ -1544,7 +1544,11 @@ gb_internal void check_range_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags)
|
||||
}
|
||||
} else if (operand.mode != Addressing_Invalid) {
|
||||
if (operand.mode == Addressing_OptionalOk || operand.mode == Addressing_OptionalOkPtr) {
|
||||
check_promote_optional_ok(ctx, &operand, nullptr, nullptr);
|
||||
Type *end_type = nullptr;
|
||||
check_promote_optional_ok(ctx, &operand, nullptr, &end_type, false);
|
||||
if (is_type_boolean(end_type)) {
|
||||
check_promote_optional_ok(ctx, &operand, nullptr, &end_type, true);
|
||||
}
|
||||
}
|
||||
bool is_ptr = is_type_pointer(operand.type);
|
||||
Type *t = base_type(type_deref(operand.type));
|
||||
|
||||
Reference in New Issue
Block a user