aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2025-01-30 11:30:38 +0000
committergingerBill <bill@gingerbill.org>2025-01-30 11:30:38 +0000
commitb48f14ba82a99932e28fb12d85e20e26e6750612 (patch)
treeb41b18fbd166b3afbd5ed86f4c34396f3ab76f75 /src/check_decl.cpp
parent22d6cabcdcda8deaa250cb2aa045561b3f68bbde (diff)
`@(export) foreign import` to be package scope level
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index bf6e39bd2..4e44aadaf 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -857,6 +857,7 @@ gb_internal Entity *init_entity_foreign_library(CheckerContext *ctx, Entity *e)
} else {
String name = ident->Ident.token.string;
Entity *found = scope_lookup(ctx->scope, name);
+
if (found == nullptr) {
if (is_blank_ident(name)) {
// NOTE(bill): link against nothing
@@ -864,7 +865,7 @@ gb_internal Entity *init_entity_foreign_library(CheckerContext *ctx, Entity *e)
error(ident, "Undeclared name: %.*s", LIT(name));
}
} else if (found->kind != Entity_LibraryName) {
- error(ident, "'%.*s' cannot be used as a library name", LIT(name));
+ error(ident, "'%.*s' cannot be used as a library name %d", LIT(name), found->kind);
} else {
// TODO(bill): Extra stuff to do with library names?
*foreign_library = found;