mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #65267 from xymus/serial-indirect-conformances
[Serialization] Keep indirect conformances knowledge with safety
This commit is contained in:
@@ -3124,14 +3124,11 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
|
||||
if (hasSafeMembers)
|
||||
return true;
|
||||
|
||||
// We can mark the extension unsafe only if it has no public
|
||||
// We can mark the extension unsafe only if it has no public
|
||||
// conformances.
|
||||
auto protocols = ext->getLocalProtocols(
|
||||
ConformanceLookupKind::OnlyExplicit);
|
||||
bool hasSafeConformances = std::any_of(protocols.begin(),
|
||||
protocols.end(),
|
||||
isDeserializationSafe);
|
||||
if (hasSafeConformances)
|
||||
if (!protocols.empty())
|
||||
return true;
|
||||
|
||||
// Truly empty extensions are safe, it may happen in swiftinterfaces.
|
||||
@@ -3141,6 +3138,9 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isa<ProtocolDecl>(decl))
|
||||
return true;
|
||||
|
||||
auto value = cast<ValueDecl>(decl);
|
||||
|
||||
// A decl is safe if formally accessible publicly.
|
||||
|
||||
Reference in New Issue
Block a user