mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Treat internally-imported bridging headers as internally-imported
When using an internal import for a bridging header, semantically treat the contents of the bridging header, and anything that it imports, as if they were imported internally. This is the actual semantic behavior we wanted from internally-imported bridging headers. This is the main semantic checking bit for rdar://74011750.
This commit is contained in:
@@ -2991,7 +2991,9 @@ SourceFile::getImportAccessLevel(const ModuleDecl *targetModule) const {
|
||||
// they are recommended over indirect imports.
|
||||
if ((!restrictiveImport.has_value() ||
|
||||
restrictiveImport->accessLevel < AccessLevel::Public) &&
|
||||
imports.isImportedBy(targetModule, getParentModule()))
|
||||
!(restrictiveImport &&
|
||||
restrictiveImport->module.importedModule->isClangHeaderImportModule()) &&
|
||||
imports.isImportedBy(targetModule, getParentModule()))
|
||||
return std::nullopt;
|
||||
|
||||
return restrictiveImport;
|
||||
|
||||
Reference in New Issue
Block a user