Merge pull request #41189 from xedin/trailing-closures-with-callAsFunction

[ConstraintSystem] Match trailing closures to implicit `.callAsFunction` when necessary
This commit is contained in:
Pavel Yaskevich
2022-02-08 17:44:55 -08:00
committed by GitHub
8 changed files with 265 additions and 23 deletions

View File

@@ -2828,6 +2828,7 @@ void ConstraintSystem::bindOverloadType(
if (!argList) {
argList = ArgumentList::createImplicit(
ctx, {Argument(SourceLoc(), ctx.Id_dynamicMember, /*expr*/ nullptr)},
/*firstTrailingClosureIndex=*/None,
AllocationArena::ConstraintSolver);
}
@@ -3353,7 +3354,8 @@ size_t Solution::getTotalMemory() const {
ConstraintRestrictions.getMemorySize() +
llvm::capacity_in_bytes(Fixes) + DisjunctionChoices.getMemorySize() +
OpenedTypes.getMemorySize() + OpenedExistentialTypes.getMemorySize() +
(DefaultedConstraints.size() * sizeof(void *));
(DefaultedConstraints.size() * sizeof(void *)) +
ImplicitCallAsFunctionRoots.getMemorySize();
}
DeclContext *Solution::getDC() const { return constraintSystem->DC; }