aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-02-19 12:11:57 +0000
committergingerBill <bill@gingerbill.org>2023-02-19 12:11:57 +0000
commitc386c72d10540a4a9af89755df7aa3a35a079b64 (patch)
treee0273b0d77e487afd02969b08813336c00f7d12d /src/check_expr.cpp
parent20eacc4a8493f0d0088ceebbcc1490207c48b5ed (diff)
Check for procedure literals in `$` parameters
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 356f0aaa3..2ed77535c 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -5419,7 +5419,17 @@ gb_internal CALL_ARGUMENT_CHECKER(check_call_arguments_internal) {
data->result_type = final_proc_type->Proc.results;
data->gen_entity = gen_entity;
- add_type_and_value(c, ce->proc, Addressing_Value, final_proc_type, {});
+
+ Ast *proc_lit = nullptr;
+ if (ce->proc->tav.value.kind == ExactValue_Procedure) {
+ Ast *vp = unparen_expr(ce->proc->tav.value.value_procedure);
+ if (vp && vp->kind == Ast_ProcLit) {
+ proc_lit = vp;
+ }
+ }
+ if (proc_lit == nullptr) {
+ add_type_and_value(c, ce->proc, Addressing_Value, final_proc_type, {});
+ }
}
return err;