Skip to content

Commit 271be17

Browse files
committed
SIL: Fix SILVerifier for local archetype substitution change
It's up to the client to substitute member types now.
1 parent b426502 commit 271be17

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6281,10 +6281,9 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
62816281
auto archetype = dyn_cast<ElementArchetypeType>(type);
62826282
if (!archetype)
62836283
return type;
6284-
if (!archetype->isRoot())
6285-
return Type();
62866284

6287-
auto it = allOpened.find(type->getCanonicalType());
6285+
auto root = archetype->getRoot();
6286+
auto it = allOpened.find(root->getCanonicalType());
62886287
assert(it != allOpened.end());
62896288

62906289
auto pack = it->second;
@@ -6295,7 +6294,13 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
62956294
} else {
62966295
assert(!indexedShape && "pack substitution doesn't match in shape");
62976296
}
6298-
return packElementType;
6297+
6298+
if (archetype->isRoot())
6299+
return packElementType;
6300+
6301+
return archetype->getInterfaceType()->castTo<DependentMemberType>()
6302+
->substRootParam(packElementType, LookUpConformanceInModule(),
6303+
std::nullopt);
62996304
};
63006305

63016306
// If the pack components and expected element types are SIL types,

0 commit comments

Comments
 (0)