mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Start detangling the uses of TypeDecl::getProtocols(). NFC
Getting the protocols of an arbitrary type doesn't make sense, so start phasing this out by introducing specialized entry points that do make sense: - get the inherited protocols of a ProtocolDecl - get the conforming protocols for an associated type or generic type parameter - (already present) ask for the protocols to which a nominal type conforms Swift SVN r26411
This commit is contained in:
@@ -54,7 +54,7 @@ static FormalLinkage
|
||||
getGenericClauseLinkage(ArrayRef<GenericTypeParamDecl *> params) {
|
||||
FormalLinkage result = FormalLinkage::Top;
|
||||
for (auto ¶m : params) {
|
||||
for (auto proto : param->getProtocols())
|
||||
for (auto proto : param->getConformingProtocols(nullptr))
|
||||
result ^= getTypeLinkage(CanType(proto->getDeclaredType()));
|
||||
if (auto superclass = param->getSuperclass())
|
||||
result ^= getTypeLinkage(superclass->getCanonicalType());
|
||||
|
||||
Reference in New Issue
Block a user