mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Improve type inference system to allow &{} alongside &T{} in some cases
This commit is contained in:
+6
-1
@@ -7335,7 +7335,12 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
|
|||||||
case_ast_node(ue, UnaryExpr, node);
|
case_ast_node(ue, UnaryExpr, node);
|
||||||
Ast *prev_unary_address_hint = c->unary_address_hint;
|
Ast *prev_unary_address_hint = c->unary_address_hint;
|
||||||
c->unary_address_hint = unparen_expr(node);
|
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;
|
c->unary_address_hint = prev_unary_address_hint;
|
||||||
node->viral_state_flags |= ue->expr->viral_state_flags;
|
node->viral_state_flags |= ue->expr->viral_state_flags;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user