SIL: Fix SILVerifier for local archetype substitution change

It's up to the client to substitute member types now.
This commit is contained in:
Slava Pestov
2024-08-15 13:53:37 -04:00
parent b4265020f6
commit 271be17491

View File

@@ -6281,10 +6281,9 @@ public:
auto archetype = dyn_cast<ElementArchetypeType>(type);
if (!archetype)
return type;
if (!archetype->isRoot())
return Type();
auto it = allOpened.find(type->getCanonicalType());
auto root = archetype->getRoot();
auto it = allOpened.find(root->getCanonicalType());
assert(it != allOpened.end());
auto pack = it->second;
@@ -6295,7 +6294,13 @@ public:
} else {
assert(!indexedShape && "pack substitution doesn't match in shape");
}
return packElementType;
if (archetype->isRoot())
return packElementType;
return archetype->getInterfaceType()->castTo<DependentMemberType>()
->substRootParam(packElementType, LookUpConformanceInModule(),
std::nullopt);
};
// If the pack components and expected element types are SIL types,