mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[NFC] Collect protocol decls, not type, in ExistentialLayout
Another thing that will be necessary for correctness with compositions of parameterized protocols.
This commit is contained in:
@@ -390,12 +390,12 @@ class InheritedProtocolCollector {
|
||||
|
||||
bool canPrintNormally = canPrintProtocolTypeNormally(inheritedTy, D);
|
||||
ExistentialLayout layout = inheritedTy->getExistentialLayout();
|
||||
for (ProtocolType *protoTy : layout.getProtocols()) {
|
||||
for (ProtocolDecl *protoDecl : layout.getProtocols()) {
|
||||
if (canPrintNormally)
|
||||
IncludedProtocols.push_back(protoTy->getDecl());
|
||||
IncludedProtocols.push_back(protoDecl);
|
||||
else
|
||||
ExtraProtocols.push_back(
|
||||
ProtocolAndAvailability(protoTy->getDecl(),
|
||||
ProtocolAndAvailability(protoDecl,
|
||||
getAvailabilityAttrs(D, availableAttrs),
|
||||
inherited.isUnchecked,
|
||||
getOtherAttrList(D)));
|
||||
@@ -433,7 +433,8 @@ class InheritedProtocolCollector {
|
||||
continue;
|
||||
|
||||
ExistentialLayout layout = inheritedTy->getExistentialLayout();
|
||||
for (ProtocolType *protoTy : layout.getProtocols()) {
|
||||
for (ProtocolDecl *protoDecl : layout.getProtocols()) {
|
||||
auto protoTy = protoDecl->getDeclaredInterfaceType()->castTo<ProtocolType>();
|
||||
if (!isPublicOrUsableFromInline(protoTy))
|
||||
continue;
|
||||
ConditionalConformanceProtocols.push_back(protoTy);
|
||||
|
||||
Reference in New Issue
Block a user