mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Let module lookups ignore access control
…at least for declarations in the current module. We continue to pretend that inaccessible declarations in other modules do not exist.
This commit is contained in:
@@ -165,6 +165,11 @@ void ModuleNameLookup<LookupStrategy>::lookupInModule(
|
||||
if (resolutionKind == ResolutionKind::MacrosOnly && !isa<MacroDecl>(VD))
|
||||
return true;
|
||||
if (respectAccessControl &&
|
||||
// NL_IgnoreAccessControl applies only to the current module.
|
||||
!((options & NL_IgnoreAccessControl) &&
|
||||
moduleScopeContext &&
|
||||
moduleScopeContext->getParentModule() ==
|
||||
VD->getDeclContext()->getParentModule()) &&
|
||||
!VD->isAccessibleFrom(moduleScopeContext, false,
|
||||
includeUsableFromInline))
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user