aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-08-27 12:14:51 +0100
committergingerBill <bill@gingerbill.org>2021-08-27 12:14:51 +0100
commitb88e9452685f9e2c0d9dd1ba0609f5158252c45b (patch)
tree4622847a692a61d335571b1d6d92b8eb823e5b70 /src/check_expr.cpp
parentbf56e3ea8dab1da71d54de320007147ae969b78f (diff)
`ERROR_BLOCK()` any usages of "Did you mean?" like behaviour whilst iterating across a scope entry map
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 32bde44c8..8607ee3cb 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -3726,11 +3726,8 @@ void check_did_you_mean_print(DidYouMeanAnswers *d) {
}
}
-gb_global BlockingMutex did_you_mean_mutex;
-
void check_did_you_mean_type(String const &name, Array<Entity *> const &fields) {
- mutex_lock(&did_you_mean_mutex);
- defer (mutex_unlock(&did_you_mean_mutex));
+ ERROR_BLOCK();
DidYouMeanAnswers d = did_you_mean_make(heap_allocator(), fields.count, name);
defer (did_you_mean_destroy(&d));
@@ -3742,8 +3739,7 @@ void check_did_you_mean_type(String const &name, Array<Entity *> const &fields)
}
void check_did_you_mean_scope(String const &name, Scope *scope) {
- mutex_lock(&did_you_mean_mutex);
- defer (mutex_unlock(&did_you_mean_mutex));
+ ERROR_BLOCK();
DidYouMeanAnswers d = did_you_mean_make(heap_allocator(), scope->elements.entries.count, name);
defer (did_you_mean_destroy(&d));
@@ -4977,6 +4973,8 @@ bool evaluate_where_clauses(CheckerContext *ctx, Ast *call_expr, Scope *scope, S
return false;
} else if (!o.value.value_bool) {
if (print_err) {
+ ERROR_BLOCK();
+
gbString str = expr_to_string(clause);
error(clause, "'where' clause evaluated to false:\n\t%s", str);
gb_string_free(str);