From 16f3bc2c0bae9ae3c5f293f49f27d2f9bc2854b5 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 9 May 2019 13:18:57 +0100 Subject: Allow comparisons with bit field values --- src/check_expr.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/check_expr.cpp') 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); -- cgit v1.2.3