diff options
| author | gingerBill <bill@gingerbill.org> | 2018-10-20 10:44:02 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-10-20 10:44:02 +0100 |
| commit | 3742d9e7e9fbb02058c7da9030a0abb023e7b244 (patch) | |
| tree | 9f4af507d413edc9705ac16579f6715673e0ecfb /src/check_expr.cpp | |
| parent | 4ac1218bf895a9f933f476bd3c36fe24dc7b9a88 (diff) | |
Move atomic intrinsics to the new built-in package intrinsics
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 60e5d2649..0e4833ef1 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -2704,11 +2704,12 @@ Entity *check_selector(CheckerContext *c, Operand *operand, Ast *node, Type *typ check_op_expr = false; entity = scope_lookup_current(import_scope, entity_name); bool is_declared = entity != nullptr; + bool allow_builtin = false; if (is_declared) { if (entity->kind == Entity_Builtin) { // NOTE(bill): Builtin's are in the universal scope which is part of every scopes hierarchy // This means that we should just ignore the found result through it - is_declared = false; + allow_builtin = entity->scope == import_scope; } else if ((entity->scope->flags&ScopeFlag_Global) == ScopeFlag_Global && (import_scope->flags&ScopeFlag_Global) == 0) { is_declared = false; } @@ -2723,7 +2724,7 @@ Entity *check_selector(CheckerContext *c, Operand *operand, Ast *node, Type *typ check_entity_decl(c, entity, nullptr, nullptr); GB_ASSERT(entity->type != nullptr); - if (!is_entity_exported(entity)) { + if (!is_entity_exported(entity, allow_builtin)) { gbString sel_str = expr_to_string(selector); error(op_expr, "'%s' is not exported by '%.*s'", sel_str, LIT(import_name)); gb_string_free(sel_str); |