diff options
Diffstat (limited to 'src/check_type.cpp')
| -rw-r--r-- | src/check_type.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp index 6194951c9..010b31f03 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -3454,6 +3454,26 @@ bool check_type_internal(CheckerContext *ctx, Ast *e, Type **type, Type *named_t return true; } case_end; + + case_ast_node(te, TernaryIfExpr, 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, TernaryWhenExpr, 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; } *type = t_invalid; |