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() {
65286528inline Type TypeBase::getNominalParent () {
65296529 if (auto existential = getAs<ExistentialType>())
65306530 return existential->getConstraintType ()->getNominalParent ();
6531-
6531+ if (auto ppt = getAs<ParameterizedProtocolType>())
6532+ return ppt->getBaseType ()->getNominalParent ();
65326533 return castTo<AnyGenericType>()->getParent ();
65336534}
65346535
Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ NominalTypeDecl *CanType::getAnyNominal() const {
106106GenericTypeDecl *CanType::getAnyGeneric () const {
107107 if (auto existential = dyn_cast<ExistentialType>(*this ))
108108 return existential->getConstraintType ()->getAnyGeneric ();
109+ if (auto ppt = dyn_cast<ParameterizedProtocolType>(*this ))
110+ return ppt->getBaseType ()->getDecl ();
109111 if (auto Ty = dyn_cast<AnyGenericType>(*this ))
110112 return Ty->getDecl ();
111113 return nullptr ;
You can’t perform that action at this time.
0 commit comments