aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-05-05 15:22:54 +0100
committergingerBill <bill@gingerbill.org>2021-05-05 15:22:54 +0100
commit278de3a92f80e1c3f1abc3ece53db6d0bba1e393 (patch)
tree7ac454d13dd24705b25997c71a78457858cb4166 /src/check_type.cpp
parentabdf54800ec282934d7b0730d13a77b46c5c663b (diff)
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.
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp10
1 files changed, 0 insertions, 10 deletions
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);