diff options
| author | gingerBill <bill@gingerbill.org> | 2019-03-06 20:01:46 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-03-06 20:01:46 +0000 |
| commit | 5c04800831d4b6b642d40e2866b88661cd8ac31e (patch) | |
| tree | 70e5fd28e75a81720e6a2d77705d1963ec158e65 /src/check_expr.cpp | |
| parent | c634d4a96d5e3fff379c72c31d268b198700277f (diff) | |
Add type inference to index expressions for maps
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 532b79969..f533a1812 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -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; |