mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-09 22:42:46 +00:00
Add type inference to index expressions for maps
This commit is contained in:
@@ -6473,7 +6473,7 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
|
||||
|
||||
if (is_type_map(t)) {
|
||||
Operand key = {};
|
||||
check_expr(c, &key, ie->index);
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user