aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-08-14 11:28:49 +0100
committergingerBill <bill@gingerbill.org>2024-08-14 11:28:49 +0100
commitfd5376ba88ef6ad8dcb4657d3159c7eee737a2af (patch)
tree987d1e33f5fa68aa1804dadac2eb484f0c23ef1a /src/check_decl.cpp
parent78fa675c1a56e2aa2e28c52415dd21d3c8970366 (diff)
Allow `@(require_results)` on `foreign` blocks
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index 1425aafa8..27c1554e6 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -1124,7 +1124,7 @@ gb_internal void check_proc_decl(CheckerContext *ctx, Entity *e, DeclInfo *d) {
e->deprecated_message = ac.deprecated_message;
e->warning_message = ac.warning_message;
- ac.link_name = handle_link_name(ctx, e->token, ac.link_name, ac.link_prefix,ac.link_suffix);
+ ac.link_name = handle_link_name(ctx, e->token, ac.link_name, ac.link_prefix, ac.link_suffix);
if (ac.has_disabled_proc) {
if (ac.disabled_proc) {
e->flags |= EntityFlag_Disabled;
@@ -1221,6 +1221,8 @@ gb_internal void check_proc_decl(CheckerContext *ctx, Entity *e, DeclInfo *d) {
} else {
pt->require_results = true;
}
+ } else if (d->foreign_require_results && pt->result_count != 0) {
+ pt->require_results = true;
}
if (ac.link_name.len > 0) {