mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge remote-tracking branch 'origin/main' into rebranch
This commit is contained in:
@@ -3290,9 +3290,10 @@ public:
|
||||
|
||||
// We can mark the extension unsafe only if it has no public
|
||||
// conformances.
|
||||
auto protocols = ext->getLocalProtocols(
|
||||
ConformanceLookupKind::OnlyExplicit);
|
||||
if (!protocols.empty())
|
||||
auto protocols = ext->getLocalProtocols(ConformanceLookupKind::All);
|
||||
bool hasSafeConformances = std::any_of(protocols.begin(), protocols.end(),
|
||||
isDeserializationSafe);
|
||||
if (hasSafeConformances)
|
||||
return true;
|
||||
|
||||
// Truly empty extensions are safe, it may happen in swiftinterfaces.
|
||||
@@ -3302,9 +3303,6 @@ public:
|
||||
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