aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2024-06-12 20:48:02 +0100
committerGitHub <noreply@github.com>2024-06-12 20:48:02 +0100
commit90815452caef2678905e83ace24964720c627f37 (patch)
tree0fe6724e2eef49bebcdccaf7f200240ba0e514b7 /src/check_expr.cpp
parent603581aa5358d34ddd899bc961c1efc6dce72820 (diff)
parent33270f14a41a61137351907ccaa5317afbe47ad5 (diff)
Merge pull request #3747 from Feoramund/fix-3739
Fix #3739
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 0f9bb781e..359b30276 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -2550,7 +2550,7 @@ gb_internal void check_unary_expr(CheckerContext *c, Operand *o, Token op, Ast *
error_line("\tSuggestion: Did you want to pass the iterable value to the for statement by pointer to get addressable semantics?\n");
}
- if (is_type_map(parent_type)) {
+ if (parent_type != nullptr && is_type_map(parent_type)) {
error_line("\t Prefer doing 'for key, &%.*s in ...'\n", LIT(e->token.string));
} else {
error_line("\t Prefer doing 'for &%.*s in ...'\n", LIT(e->token.string));