aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-05-30 15:27:09 +0100
committergingerBill <bill@gingerbill.org>2022-05-30 15:27:09 +0100
commit5b42dd7707a8921321958934cf5d75ada1d8a006 (patch)
tree6aec2cbfbd3b21980dbb4df1371acce5bf2a708b /src/check_decl.cpp
parent51707032d10d166094959d49e597b322a8d7c55d (diff)
Correct `@(require_results)` on parapoly procedures
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index d4818892b..86280b6cb 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -1014,10 +1014,12 @@ void check_proc_decl(CheckerContext *ctx, Entity *e, DeclInfo *d) {
}
}
- if (pt->result_count == 0 && ac.require_results) {
- error(pl->type, "'require_results' is not needed on a procedure with no results");
- } else {
- pt->require_results = ac.require_results;
+ if (ac.require_results) {
+ if (pt->result_count == 0) {
+ error(pl->type, "'require_results' is not needed on a procedure with no results");
+ } else {
+ pt->require_results = true;
+ }
}
if (ac.link_name.len > 0) {