From 6726df4d58b2538014b1e9487eddd8de26bc89fa Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 20 Apr 2023 11:20:15 +0100 Subject: [PATCH] Allow aliasing foreign import name --- src/check_expr.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/check_expr.cpp b/src/check_expr.cpp index de9a6b911..42306489b 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -1631,7 +1631,9 @@ gb_internal Entity *check_ident(CheckerContext *c, Operand *o, Ast *n, Type *nam } return e; case Entity_LibraryName: - error(n, "Use of library '%.*s' not in foreign block", LIT(name)); + if (!allow_import_name) { + error(n, "Use of library '%.*s' not in foreign block", LIT(name)); + } return e; case Entity_Label: