mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Fix when within foreign blocks at the file scope
This commit is contained in:
@@ -3924,6 +3924,7 @@ gb_internal void correct_type_aliases_in_scope(CheckerContext *c, Scope *s) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gb_internal bool collect_file_decl(CheckerContext *ctx, Ast *decl);
|
||||||
|
|
||||||
// NOTE(bill): If file_scopes == nullptr, this will act like a local scope
|
// NOTE(bill): If file_scopes == nullptr, this will act like a local scope
|
||||||
gb_internal void check_collect_entities(CheckerContext *c, Slice<Ast *> const &nodes) {
|
gb_internal void check_collect_entities(CheckerContext *c, Slice<Ast *> const &nodes) {
|
||||||
@@ -4005,6 +4006,13 @@ gb_internal void check_collect_entities(CheckerContext *c, Slice<Ast *> const &n
|
|||||||
check_collect_entities_from_when_stmt(c, &decl->WhenStmt);
|
check_collect_entities_from_when_stmt(c, &decl->WhenStmt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (c->foreign_context.curr_library) {
|
||||||
|
for_array(decl_index, nodes) {
|
||||||
|
Ast *decl = nodes[decl_index];
|
||||||
|
if (decl->kind == Ast_WhenStmt) {
|
||||||
|
collect_file_decl(c, decl);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user