[GenericEnvironment] For opened pack element environments, only include element type

parameters whose originating packs are in a given shape equivalence class.
This commit is contained in:
Holly Borla
2023-01-07 00:39:48 -08:00
parent 715de13dbf
commit 2d893d23bf
11 changed files with 86 additions and 28 deletions

View File

@@ -1529,6 +1529,7 @@ void Serializer::writeASTBlockEntity(const GenericEnvironment *genericEnv) {
case GenericEnvironment::Kind::OpenedElement: {
auto kind = GenericEnvironmentKind::OpenedElement;
auto shapeClassID = addTypeRef(genericEnv->getOpenedElementShapeClass());
auto parentSig = genericEnv->getGenericSignature();
auto parentSigID = addGenericSignatureRef(parentSig);
auto contextSubs = genericEnv->getPackElementContextSubstitutions();
@@ -1536,7 +1537,7 @@ void Serializer::writeASTBlockEntity(const GenericEnvironment *genericEnv) {
auto genericEnvAbbrCode = DeclTypeAbbrCodes[GenericEnvironmentLayout::Code];
GenericEnvironmentLayout::emitRecord(Out, ScratchRecord, genericEnvAbbrCode,
unsigned(kind), /*existentialTypeID=*/0,
unsigned(kind), shapeClassID,
parentSigID, subsID);
return;
}