mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-14 09:52:23 -07:00
Unify AstTernaryExpr with AstTernaryIfExpr
Allow for both syntaxes `x if cond else y` and `cond ? x : y` Removes the confusing semantics behind `?:` which could be `if` or `when` depending on the context.
This commit is contained in:
@@ -2889,16 +2889,6 @@ bool check_type_internal(CheckerContext *ctx, Ast *e, Type **type, Type *named_t
|
||||
}
|
||||
case_end;
|
||||
|
||||
case_ast_node(te, TernaryExpr, e);
|
||||
Operand o = {};
|
||||
check_expr_or_type(ctx, &o, e);
|
||||
if (o.mode == Addressing_Type) {
|
||||
*type = o.type;
|
||||
set_base_type(named_type, *type);
|
||||
return true;
|
||||
}
|
||||
case_end;
|
||||
|
||||
case_ast_node(te, TernaryIfExpr, e);
|
||||
Operand o = {};
|
||||
check_expr_or_type(ctx, &o, e);
|
||||
|
||||
Reference in New Issue
Block a user