Add type inference to index expressions for maps

This commit is contained in:
gingerBill
2019-03-06 20:01:46 +00:00
parent c634d4a96d
commit 5c04800831

View File

@@ -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;