Minimize error propagation of map[key] indexing

This commit is contained in:
gingerBill
2026-06-14 18:55:26 +01:00
parent c49e296f5e
commit 2cf2a1341b

View File

@@ -11761,11 +11761,11 @@ gb_internal ExprKind check_index_expr(CheckerContext *c, Operand *o, Ast *node,
check_expr_with_type_hint(c, &key, ie->index, t->Map.key);
}
check_assignment(c, &key, t->Map.key, str_lit("map index"));
if (key.mode == Addressing_Invalid) {
o->mode = Addressing_Invalid;
o->expr = node;
return kind;
}
// if (key.mode == Addressing_Invalid) {
// o->mode = Addressing_Invalid;
// o->expr = node;
// return kind;
// }
o->mode = Addressing_MapIndex;
o->type = t->Map.value;
o->expr = node;