File tree Expand file tree Collapse file tree 3 files changed +5
-10
lines changed Expand file tree Collapse file tree 3 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -5734,9 +5734,6 @@ class NestedArchetypeType final : public ArchetypeType,
5734
5734
GenericEnvironment *Environment);
5735
5735
};
5736
5736
BEGIN_CAN_TYPE_WRAPPER (NestedArchetypeType, ArchetypeType)
5737
- CanArchetypeType getParent() const {
5738
- return CanArchetypeType (getPointer ()->getParent ());
5739
- }
5740
5737
END_CAN_TYPE_WRAPPER(NestedArchetypeType, ArchetypeType)
5741
5738
5742
5739
// / An archetype that represents an opaque element of a type sequence in context.
@@ -6615,7 +6612,7 @@ inline bool TypeBase::hasSimpleTypeRepr() const {
6615
6612
return false ;
6616
6613
6617
6614
case TypeKind::NestedArchetype:
6618
- return cast<NestedArchetypeType>(this )->getParent ()->hasSimpleTypeRepr ();
6615
+ return cast<NestedArchetypeType>(this )->getRoot ()->hasSimpleTypeRepr ();
6619
6616
6620
6617
case TypeKind::OpaqueTypeArchetype:
6621
6618
case TypeKind::OpenedArchetype:
Original file line number Diff line number Diff line change @@ -3742,7 +3742,6 @@ namespace {
3742
3742
void visitNestedArchetypeType (NestedArchetypeType *T, StringRef label) {
3743
3743
printArchetypeCommon (T, " nested_archetype_type" , label);
3744
3744
printField (" name" , T->getFullName ());
3745
- printField (" parent" , T->getParent ());
3746
3745
printField (" assoc_type" , T->getAssocType ()->printRef ());
3747
3746
PrintWithColorRAII (OS, ParenthesisColor) << ' )' ;
3748
3747
}
Original file line number Diff line number Diff line change @@ -3211,11 +3211,10 @@ ArchetypeType::ArchetypeType(TypeKind Kind,
3211
3211
}
3212
3212
3213
3213
ArchetypeType *ArchetypeType::getRoot () const {
3214
- auto parent = this ;
3215
- while (auto nested = dyn_cast<NestedArchetypeType>(parent)) {
3216
- parent = nested->getParent ();
3217
- }
3218
- return const_cast <ArchetypeType*>(parent);
3214
+ auto gp = InterfaceType->getRootGenericParam ();
3215
+ assert (gp && " Missing root generic parameter?" );
3216
+ return getGenericEnvironment ()->mapTypeIntoContext (
3217
+ Type (gp))->castTo <ArchetypeType>();
3219
3218
}
3220
3219
3221
3220
Type ArchetypeType::getExistentialType () const {
You can’t perform that action at this time.
0 commit comments