diff options
| author | gingerBill <bill@gingerbill.org> | 2019-05-09 13:18:57 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-05-09 13:18:57 +0100 |
| commit | 16f3bc2c0bae9ae3c5f293f49f27d2f9bc2854b5 (patch) | |
| tree | 668d749886043c9231de9c2e7694dd7153feb6b2 /src/check_expr.cpp | |
| parent | 71a733e3b5bda4e8baafac35c7140e0b3a0d9445 (diff) | |
Allow comparisons with bit field values
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index d81760211..a7e4a21e2 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -535,6 +535,11 @@ i64 check_distance_between_types(CheckerContext *c, Operand *operand, Type *type return 1; } + if (is_type_bit_field_value(operand->type) && is_type_bit_field_value(type)) { + return 1; + } + + { isize subtype_level = check_is_assignable_to_using_subtype(operand->type, type); |