mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-14 15:23:15 +00:00
Allow @(require_results) on foreign blocks
This commit is contained in:
@@ -3212,6 +3212,12 @@ gb_internal DECL_ATTRIBUTE_PROC(foreign_block_decl_attribute) {
|
||||
}
|
||||
c->foreign_context.visibility_kind = kind;
|
||||
return true;
|
||||
} else if (name == "require_results") {
|
||||
if (value != nullptr) {
|
||||
error(elem, "Expected no value for '%.*s'", LIT(name));
|
||||
}
|
||||
c->foreign_context.require_results = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -4300,6 +4306,7 @@ gb_internal void check_collect_value_decl(CheckerContext *c, Ast *decl) {
|
||||
}
|
||||
ast_node(pl, ProcLit, init);
|
||||
e = alloc_entity_procedure(d->scope, token, nullptr, pl->tags);
|
||||
d->foreign_require_results = c->foreign_context.require_results;
|
||||
if (fl != nullptr) {
|
||||
GB_ASSERT(fl->kind == Ast_Ident);
|
||||
e->Procedure.foreign_library_ident = fl;
|
||||
|
||||
Reference in New Issue
Block a user