Handle explicit lifetime dependence specifiers in initializers

This commit is contained in:
Meghana Gupta
2024-02-01 10:25:34 -08:00
parent a6dbfa9c53
commit c8ece100ba
19 changed files with 191 additions and 50 deletions

View File

@@ -423,15 +423,16 @@ deriveRawRepresentable_init(DerivedConformance &derived) {
auto paramList = ParameterList::createWithoutLoc(rawDecl);
DeclName name(C, DeclBaseName::createConstructor(), paramList);
auto initDecl =
new (C) ConstructorDecl(name, SourceLoc(),
/*Failable=*/ true, /*FailabilityLoc=*/SourceLoc(),
/*Async=*/false, /*AsyncLoc=*/SourceLoc(),
/*Throws=*/false, /*ThrowsLoc=*/SourceLoc(),
/*ThrownType=*/TypeLoc(), paramList,
/*GenericParams=*/nullptr, parentDC);
new (C) ConstructorDecl(name, SourceLoc(),
/*Failable=*/true, /*FailabilityLoc=*/SourceLoc(),
/*Async=*/false, /*AsyncLoc=*/SourceLoc(),
/*Throws=*/false, /*ThrowsLoc=*/SourceLoc(),
/*ThrownType=*/TypeLoc(), paramList,
/*GenericParams=*/nullptr, parentDC,
/*LifetimeDependentReturnTypeRepr*/ nullptr);
initDecl->setImplicit();
initDecl->setBodySynthesizer(&deriveBodyRawRepresentable_init);
addNonIsolatedToSynthesized(enumDecl, initDecl);