[ast] Refactor BindingPattern to take a VarDecl::Introducer directly instead of a bool to mean a let.

I am going to be adding more VarDecl::Introducers so this is a small nice
cleanup that is cut off the larger patch.
This commit is contained in:
Michael Gottesman
2023-02-28 11:37:37 -08:00
parent 52f46be301
commit ed57d882d3
7 changed files with 42 additions and 23 deletions

View File

@@ -1650,7 +1650,8 @@ deriveBodyDecodable_enum_init(AbstractFunctionDecl *initDecl, void *) {
C, UnresolvedDotExpr::createImplicit(C, allKeysExpr, C.Id_popFirst));
auto *theKeyPattern = BindingPattern::createImplicit(
C, /*isLet=*/true, NamedPattern::createImplicit(C, theKeyDecl));
C, VarDecl::Introducer::Let,
NamedPattern::createImplicit(C, theKeyDecl));
guardElements.emplace_back(SourceLoc(), theKeyPattern,
allKeysPopFirstCallExpr);