[ConstraintSystem] NFC: Use stored result type while generating constraints for closures

Instead of passing/storing result type to constraint generator,
let's retrieve it from the constraint system when needed.
This commit is contained in:
Pavel Yaskevich
2021-07-14 16:28:26 -07:00
parent b7ccf1be48
commit 3e73f88512
3 changed files with 10 additions and 15 deletions

View File

@@ -8950,7 +8950,7 @@ bool ConstraintSystem::resolveClosure(TypeVariableType *typeVar,
// generate constraints for it now.
auto &ctx = getASTContext();
if (shouldTypeCheckInEnclosingExpression(closure)) {
if (generateConstraints(closure, closureType->getResult()))
if (generateConstraints(closure))
return false;
} else if (!hasExplicitResult(closure)) {
// If this closure has an empty body and no explicit result type