Improve type inference system to allow &{} alongside &T{} in some cases

This commit is contained in:
gingerBill
2021-05-06 14:06:22 +01:00
parent 502ad0c10b
commit 902be0d09c

View File

@@ -7335,7 +7335,12 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
case_ast_node(ue, UnaryExpr, node);
Ast *prev_unary_address_hint = c->unary_address_hint;
c->unary_address_hint = unparen_expr(node);
check_expr_base(c, o, ue->expr, type_hint);
Type *th = type_hint;
if (ue->op.kind == Token_And) {
th = type_deref(th);
}
check_expr_base(c, o, ue->expr, th);
c->unary_address_hint = prev_unary_address_hint;
node->viral_state_flags |= ue->expr->viral_state_flags;