mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Sema] Restrict reexported SPIs to modules with an export_as relationship
@_exported exports SPIs only when the exported module defines export_as pointing to the exporter module. Other reexports do not reexport SPIs. This is to prevent SPI reexporting to get out of hands with the wide reexports of the Objective-C world. rdar://102335473
This commit is contained in:
@@ -1494,7 +1494,8 @@ void SerializedASTFile::lookupImportedSPIGroups(
|
||||
continue;
|
||||
|
||||
if (dep.Import->importedModule == importedModule ||
|
||||
imports.isImportedBy(importedModule, dep.Import->importedModule)) {
|
||||
(imports.isImportedBy(importedModule, dep.Import->importedModule) &&
|
||||
importedModule->isExportedAs(dep.Import->importedModule))) {
|
||||
spiGroups.insert(dep.spiGroups.begin(), dep.spiGroups.end());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user