mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge remote-tracking branch 'origin/master' into master-rebranch
This commit is contained in:
@@ -170,6 +170,24 @@ PrintOptions PrintOptions::printSwiftInterfaceFile(bool preferTypeRepr,
|
||||
if (auto *ED = dyn_cast<ExtensionDecl>(D)) {
|
||||
if (!shouldPrint(ED->getExtendedNominal(), options))
|
||||
return false;
|
||||
|
||||
// Skip extensions to implementation-only imported types that have
|
||||
// no public members.
|
||||
auto localModule = ED->getParentModule();
|
||||
auto nominalModule = ED->getExtendedNominal()->getParentModule();
|
||||
if (localModule != nominalModule &&
|
||||
localModule->isImportedImplementationOnly(nominalModule)) {
|
||||
|
||||
bool shouldPrintMembers = llvm::any_of(
|
||||
ED->getMembers(),
|
||||
[&](const Decl *member) -> bool {
|
||||
return shouldPrint(member, options);
|
||||
});
|
||||
|
||||
if (!shouldPrintMembers)
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const Requirement &req : ED->getGenericRequirements()) {
|
||||
if (!isPublicOrUsableFromInline(req.getFirstType()))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user