Merge pull request #73685 from slavapestov/pack-expansion-closures-part-5

Pack expansion closures, part 5
This commit is contained in:
Slava Pestov
2024-05-17 07:42:06 -04:00
committed by GitHub
12 changed files with 179 additions and 47 deletions

View File

@@ -656,7 +656,8 @@ protected:
void appendClosureEntity(const AbstractClosureExpr *closure);
void appendClosureComponents(Type Ty, unsigned discriminator, bool isImplicit,
const DeclContext *parentContext);
const DeclContext *parentContext,
ArrayRef<GenericEnvironment *> capturedEnvs);
void appendDefaultArgumentEntity(const DeclContext *ctx, unsigned index);

View File

@@ -53,6 +53,17 @@ struct MapLocalArchetypesOutOfContext {
Type operator()(SubstitutableType *type) const;
};
struct MapIntoLocalArchetypeContext {
GenericEnvironment *baseGenericEnv;
ArrayRef<GenericEnvironment *> capturedEnvs;
MapIntoLocalArchetypeContext(GenericEnvironment *baseGenericEnv,
ArrayRef<GenericEnvironment *> capturedEnvs)
: baseGenericEnv(baseGenericEnv), capturedEnvs(capturedEnvs) {}
Type operator()(SubstitutableType *type) const;
};
GenericSignature buildGenericSignatureWithCapturedEnvironments(
ASTContext &ctx,
GenericSignature sig,