File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -6528,7 +6528,8 @@ inline NominalTypeDecl *TypeBase::getAnyNominal() {
6528
6528
inline Type TypeBase::getNominalParent () {
6529
6529
if (auto existential = getAs<ExistentialType>())
6530
6530
return existential->getConstraintType ()->getNominalParent ();
6531
-
6531
+ if (auto ppt = getAs<ParameterizedProtocolType>())
6532
+ return ppt->getBaseType ()->getNominalParent ();
6532
6533
return castTo<AnyGenericType>()->getParent ();
6533
6534
}
6534
6535
Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ NominalTypeDecl *CanType::getAnyNominal() const {
106
106
GenericTypeDecl *CanType::getAnyGeneric () const {
107
107
if (auto existential = dyn_cast<ExistentialType>(*this ))
108
108
return existential->getConstraintType ()->getAnyGeneric ();
109
+ if (auto ppt = dyn_cast<ParameterizedProtocolType>(*this ))
110
+ return ppt->getBaseType ()->getDecl ();
109
111
if (auto Ty = dyn_cast<AnyGenericType>(*this ))
110
112
return Ty->getDecl ();
111
113
return nullptr ;
You can’t perform that action at this time.
0 commit comments