diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-01-27 16:34:58 +0000 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-01-27 16:34:58 +0000 |
| commit | 832009f33acc573d44dd9dfb470ad8fef72216ff (patch) | |
| tree | b34120bf3d81739d7f516efb54235aaa2d15d04e /src/check_expr.c | |
| parent | d3d3bfd4557c23da58a33066c4a7e5042435829d (diff) | |
`in` keyword for `for` and `match type`
Diffstat (limited to 'src/check_expr.c')
| -rw-r--r-- | src/check_expr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/check_expr.c b/src/check_expr.c index 273f237fb..f6037beee 100644 --- a/src/check_expr.c +++ b/src/check_expr.c @@ -4071,19 +4071,21 @@ ExprKind check__expr_base(Checker *c, Operand *o, AstNode *node, Type *type_hint error_node(ie->cond, "Non-boolean condition in if expression"); } - Operand x = {Addressing_Invalid}; Operand y = {Addressing_Invalid}; Type *if_type = NULL; Type *else_type = NULL; - check_expr(c, &x, ie->body); + if (type_hint) { + gb_printf_err("here\n"); + } + check_expr_with_type_hint(c, &x, ie->body, type_hint); if_type = x.type; if (ie->else_expr != NULL) { switch (ie->else_expr->kind) { case AstNode_IfExpr: case AstNode_BlockExpr: - check_expr(c, &y, ie->else_expr); + check_expr_with_type_hint(c, &y, ie->else_expr, if_type); else_type = y.type; break; default: |