diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2023-08-31 15:19:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-31 15:19:27 +0100 |
| commit | 4aa4317c286a59c1ce16cb45189c9bd372e28a63 (patch) | |
| tree | fe84c474c9615d367e5429d5b0e1bed55be144d6 /src/check_expr.cpp | |
| parent | 434c84043d7de8e2d579e4b3444da9f579b32237 (diff) | |
| parent | a182dc78f45cdbdca6675f945d3fbd5a61ca3250 (diff) | |
Merge pull request #2780 from laytan/fix-ternary-with-union-of-enum
fix #2779 ternary with a union of enum
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 399c25a9d..a0d3c24bf 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -7927,7 +7927,7 @@ gb_internal ExprKind check_ternary_if_expr(CheckerContext *c, Operand *o, Ast *n // NOTE(bill, 2023-01-30): Allow for expression like this: // x: union{f32} = f32(123) if cond else nil - if (type_hint && !is_type_any(type_hint) && !ternary_compare_types(x.type, y.type)) { + if (type_hint && !is_type_any(type_hint)) { if (check_is_assignable_to(c, &x, type_hint) && check_is_assignable_to(c, &y, type_hint)) { check_cast(c, &x, type_hint); check_cast(c, &y, type_hint); |