Merge pull request #62228 from hborla/pack-element-generic-environment

[GenericEnvironment] Include original parameter packs in opened pack element signatures.
This commit is contained in:
Holly Borla
2022-11-28 15:34:35 -05:00
committed by GitHub
14 changed files with 301 additions and 118 deletions

View File

@@ -1504,11 +1504,13 @@ void Serializer::writeASTBlockEntity(const GenericEnvironment *genericEnv) {
auto existentialTypeID = addTypeRef(genericEnv->getOpenedExistentialType());
auto parentSig = genericEnv->getOpenedExistentialParentSignature();
auto parentSigID = addGenericSignatureRef(parentSig);
auto emptySubs = SubstitutionMap();
auto subsID = addSubstitutionMapRef(emptySubs);
auto genericEnvAbbrCode = DeclTypeAbbrCodes[GenericEnvironmentLayout::Code];
GenericEnvironmentLayout::emitRecord(Out, ScratchRecord, genericEnvAbbrCode,
unsigned(kind), existentialTypeID,
parentSigID);
parentSigID, subsID);
return;
}
@@ -1516,11 +1518,13 @@ void Serializer::writeASTBlockEntity(const GenericEnvironment *genericEnv) {
auto kind = GenericEnvironmentKind::OpenedElement;
auto parentSig = genericEnv->getGenericSignature();
auto parentSigID = addGenericSignatureRef(parentSig);
auto contextSubs = genericEnv->getPackElementContextSubstitutions();
auto subsID = addSubstitutionMapRef(contextSubs);
auto genericEnvAbbrCode = DeclTypeAbbrCodes[GenericEnvironmentLayout::Code];
GenericEnvironmentLayout::emitRecord(Out, ScratchRecord, genericEnvAbbrCode,
unsigned(kind), /*existentialTypeID=*/0,
parentSigID);
parentSigID, subsID);
return;
}