aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-07-10 11:18:19 +0100
committergingerBill <bill@gingerbill.org>2021-07-10 11:18:19 +0100
commit366227511912bf6aec670f187437c48ddb09293b (patch)
tree4ce17d70ed110f9be484a1b9e93b0732d2831a4f /src/check_stmt.cpp
parent141573c18cba4ecde552fec53d73c74f854e2b8b (diff)
Allow `x in ptr_to_map_or_bit_set`
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp3
1 files changed, 2 insertions, 1 deletions
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");