Skip to content

Commit d2c0efe

Browse files
committed
AST: Remove a usage of ArchetypeType::getRoot()
1 parent 9a5408c commit d2c0efe

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

lib/AST/TypeSubstitution.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,14 +1123,8 @@ static bool canSubstituteTypeInto(Type ty, const DeclContext *dc,
11231123
bool isContextWholeModule) {
11241124
TypeDecl *typeDecl = ty->getAnyNominal();
11251125
if (!typeDecl) {
1126-
// The referenced type might be a different opaque result type.
1127-
1128-
// First, unwrap any nested associated types to get the root archetype.
1129-
if (auto nestedTy = ty->getAs<ArchetypeType>())
1130-
ty = nestedTy->getRoot();
1131-
1132-
// If the root archetype is an opaque result type, check that its
1133-
// descriptor is accessible.
1126+
// If the referenced type is a different opaque result type,
1127+
// check that its descriptor is accessible.
11341128
if (auto opaqueTy = ty->getAs<OpaqueTypeArchetypeType>())
11351129
typeDecl = opaqueTy->getDecl();
11361130
}

0 commit comments

Comments
 (0)