From 366227511912bf6aec670f187437c48ddb09293b Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 10 Jul 2021 11:18:19 +0100 Subject: Allow `x in ptr_to_map_or_bit_set` --- src/check_stmt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/check_stmt.cpp') diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index d68524994..5ae82bc5e 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -1884,7 +1884,8 @@ void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) { error(operand.expr, "Cannot iterate over '%s' of type '%s'", s, t); if (rs->vals.count == 1) { - if (is_type_map(operand.type) || is_type_bit_set(operand.type)) { + Type *t = type_deref(operand.type); + if (is_type_map(t) || is_type_bit_set(t)) { gbString v = expr_to_string(rs->vals[0]); defer (gb_string_free(v)); error_line("\tSuggestion: place parentheses around the expression\n"); -- cgit v1.2.3