mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Refactor existential type accessors on TypeBase and CanType
This commit is contained in:
@@ -88,12 +88,14 @@ static bool extendedTypeIsPrivate(TypeLoc inheritedType) {
|
||||
if (!inheritedType.getType())
|
||||
return true;
|
||||
|
||||
SmallVector<ProtocolDecl *, 2> protocols;
|
||||
if (!inheritedType.getType()->isAnyExistentialType(protocols)) {
|
||||
if (!inheritedType.getType()->isExistentialType()) {
|
||||
// Be conservative. We don't know how to deal with other extended types.
|
||||
return false;
|
||||
}
|
||||
|
||||
SmallVector<ProtocolDecl *, 2> protocols;
|
||||
inheritedType.getType()->getExistentialTypeProtocols(protocols);
|
||||
|
||||
return std::all_of(protocols.begin(), protocols.end(), declIsPrivate);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user