mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Add type inference to index expressions for maps
This commit is contained in:
+1
-1
@@ -6473,7 +6473,7 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
|
|||||||
|
|
||||||
if (is_type_map(t)) {
|
if (is_type_map(t)) {
|
||||||
Operand key = {};
|
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"));
|
check_assignment(c, &key, t->Map.key, str_lit("map index"));
|
||||||
if (key.mode == Addressing_Invalid) {
|
if (key.mode == Addressing_Invalid) {
|
||||||
o->mode = Addressing_Invalid;
|
o->mode = Addressing_Invalid;
|
||||||
|
|||||||
Reference in New Issue
Block a user