Merge pull request #40587 from CodaFi/substitute-teacher

Initial Semantics for Variadic Generics
This commit is contained in:
Robert Widmann
2021-12-20 11:25:25 -08:00
committed by GitHub
45 changed files with 1421 additions and 104 deletions

View File

@@ -4107,7 +4107,10 @@ GenericTypeParamDecl::GenericTypeParamDecl(DeclContext *dc, Identifier name,
assert(Bits.GenericTypeParamDecl.Index == index && "Truncation");
Bits.GenericTypeParamDecl.TypeSequence = isTypeSequence;
auto &ctx = dc->getASTContext();
auto type = new (ctx, AllocationArena::Permanent) GenericTypeParamType(this);
RecursiveTypeProperties props = RecursiveTypeProperties::HasTypeParameter;
if (this->isTypeSequence())
props |= RecursiveTypeProperties::HasTypeSequence;
auto type = new (ctx, AllocationArena::Permanent) GenericTypeParamType(this, props);
setInterfaceType(MetatypeType::get(type, ctx));
}