aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-08-18 21:47:09 +0100
committergingerBill <gingerBill@users.noreply.github.com>2025-08-18 21:47:09 +0100
commit409e3975669eb0d96655c84227d97512db80e72b (patch)
treed6584ed731df77420153e5c3e72bd3901b1bc008 /src/check_expr.cpp
parentf8b56ccd88178a54cae8769d438fbb51b56c0469 (diff)
Fix bug with `$fn: proc()` when passed with a global variable
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 7020b4f4b..862dd9278 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -6472,6 +6472,14 @@ gb_internal CallArgumentError check_call_arguments_internal(CheckerContext *c, A
}
}
+ if (e && e->kind == Entity_Constant && is_type_proc(e->type)) {
+ if (o->mode != Addressing_Constant) {
+ if (show_error) {
+ error(o->expr, "Expected a constant procedure value for the argument '%.*s'", LIT(e->token.string));
+ }
+ err = CallArgumentError_NoneConstantParameter;
+ }
+ }
if (!err && is_type_any(param_type)) {
add_type_info_type(c, o->type);