aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-10-08 11:08:15 +0100
committerGinger Bill <bill@gingerbill.org>2017-10-08 11:08:15 +0100
commit580ee5cc4afb6ee15785e57747559d885af16d55 (patch)
treef76d11974faa7a1a77b5a9c17aceb342518b26f9 /src/check_stmt.cpp
parent56a98a483f34cf5a76d583a6b55a586ceb83084b (diff)
Fix `using` on import names
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp
index 0d8a4fb24..d7caae280 100644
--- a/src/check_stmt.cpp
+++ b/src/check_stmt.cpp
@@ -482,6 +482,8 @@ bool check_using_stmt_entity(Checker *c, AstNodeUsingStmt *us, AstNode *expr, bo
if (t->kind == Type_Enum) {
for (isize i = 0; i < t->Enum.field_count; i++) {
Entity *f = t->Enum.fields[i];
+ if (!is_entity_exported(f)) continue;
+
Entity *found = scope_insert_entity(c->context.scope, f);
if (found != nullptr) {
gbString expr_str = expr_to_string(expr);
@@ -502,6 +504,8 @@ bool check_using_stmt_entity(Checker *c, AstNodeUsingStmt *us, AstNode *expr, bo
Scope *scope = e->ImportName.scope;
for_array(i, scope->elements.entries) {
Entity *decl = scope->elements.entries[i].value;
+ if (!is_entity_exported(decl)) continue;
+
Entity *found = scope_insert_entity(c->context.scope, decl);
if (found != nullptr) {
gbString expr_str = expr_to_string(expr);