mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ModuleInterface] Fix implementation-only imported type leak in indirect conformance
Don't print indirect conformances for protocols that are implementation-only imported. Indirect conformances are synthesized when the middle protocol is internal and not printed in the swiftinterface. This logic didn't previously check for implementation-only imports, likely because type-checking usually forbids it. Let's still protect this use case as we are considering relaxing this type-checking restriction in the future. rdar://78718838
This commit is contained in:
@@ -562,7 +562,8 @@ public:
|
||||
return TypeWalker::Action::Continue;
|
||||
|
||||
if (isPublicOrUsableFromInline(inherited) &&
|
||||
conformanceDeclaredInModule(M, nominal, inherited)) {
|
||||
conformanceDeclaredInModule(M, nominal, inherited) &&
|
||||
!M->isImportedImplementationOnly(inherited->getParentModule())) {
|
||||
protocolsToPrint.push_back({inherited, protoAndAvailability.second});
|
||||
return TypeWalker::Action::SkipChildren;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user