mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Disallow for x in y.(T) and for x in y.?
This commit is contained in:
+7
-4
@@ -1546,10 +1546,13 @@ gb_internal void check_range_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags)
|
|||||||
}
|
}
|
||||||
} else if (operand.mode != Addressing_Invalid) {
|
} else if (operand.mode != Addressing_Invalid) {
|
||||||
if (operand.mode == Addressing_OptionalOk || operand.mode == Addressing_OptionalOkPtr) {
|
if (operand.mode == Addressing_OptionalOk || operand.mode == Addressing_OptionalOkPtr) {
|
||||||
Type *end_type = nullptr;
|
Ast *expr = unparen_expr(operand.expr);
|
||||||
check_promote_optional_ok(ctx, &operand, nullptr, &end_type, false);
|
if (expr->kind != Ast_TypeAssertion) { // Only for procedure calls
|
||||||
if (is_type_boolean(end_type)) {
|
Type *end_type = nullptr;
|
||||||
check_promote_optional_ok(ctx, &operand, nullptr, &end_type, true);
|
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);
|
bool is_ptr = is_type_pointer(operand.type);
|
||||||
|
|||||||
Reference in New Issue
Block a user