mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-05 04:27:51 +00:00
Checking if entity is exported before checking if it's a procedure group
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#include <iostream>
|
||||
|
||||
enum CallArgumentError {
|
||||
CallArgumentError_None,
|
||||
CallArgumentError_NoneProcedureType,
|
||||
@@ -5373,16 +5375,6 @@ gb_internal Entity *check_selector(CheckerContext *c, Operand *operand, Ast *nod
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
check_entity_decl(c, entity, nullptr, nullptr);
|
||||
if (entity->kind == Entity_ProcGroup) {
|
||||
operand->mode = Addressing_ProcGroup;
|
||||
operand->proc_group = entity;
|
||||
|
||||
add_type_and_value(c, operand->expr, operand->mode, operand->type, operand->value);
|
||||
return entity;
|
||||
}
|
||||
GB_ASSERT_MSG(entity->type != nullptr, "%.*s (%.*s)", LIT(entity->token.string), LIT(entity_strings[entity->kind]));
|
||||
|
||||
if (!is_entity_exported(entity, allow_builtin)) {
|
||||
gbString sel_str = expr_to_string(selector);
|
||||
error(node, "'%s' is not exported by '%.*s'", sel_str, LIT(import_name));
|
||||
@@ -5393,6 +5385,16 @@ gb_internal Entity *check_selector(CheckerContext *c, Operand *operand, Ast *nod
|
||||
// return nullptr;
|
||||
}
|
||||
|
||||
check_entity_decl(c, entity, nullptr, nullptr);
|
||||
if (entity->kind == Entity_ProcGroup) {
|
||||
operand->mode = Addressing_ProcGroup;
|
||||
operand->proc_group = entity;
|
||||
|
||||
add_type_and_value(c, operand->expr, operand->mode, operand->type, operand->value);
|
||||
return entity;
|
||||
}
|
||||
GB_ASSERT_MSG(entity->type != nullptr, "%.*s (%.*s)", LIT(entity->token.string), LIT(entity_strings[entity->kind]));
|
||||
|
||||
if (entity->kind == Entity_ProcGroup) {
|
||||
Array<Entity *> procs = entity->ProcGroup.entities;
|
||||
bool skip = false;
|
||||
|
||||
Reference in New Issue
Block a user