From 278de3a92f80e1c3f1abc3ece53db6d0bba1e393 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 5 May 2021 15:22:54 +0100 Subject: 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. --- src/check_type.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src/check_type.cpp') diff --git a/src/check_type.cpp b/src/check_type.cpp index f70230682..b90732e00 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -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); -- cgit v1.2.3