Check root archetypes in a few more places.

This makes more code agnostic to the presence of NestedArchetypeType.
This commit is contained in:
Doug Gregor
2022-01-13 22:03:17 -08:00
parent ca2c44d975
commit 96fdbe18ea
4 changed files with 18 additions and 13 deletions

View File

@@ -2442,7 +2442,8 @@ public:
// and not both.
if (auto *archetypeType = t->getAs<ArchetypeType>()) {
// Don't erase opaque archetype.
if (isa<OpaqueTypeArchetypeType>(archetypeType))
if (isa<OpaqueTypeArchetypeType>(archetypeType) &&
archetypeType->isRoot())
return t;
auto protos = archetypeType->getConformsTo();