Skip to content

Commit bbdbb47

Browse files
committed
[CSApply] Switch delayed closure processing to use participatesInInference
Instead of checking the frontend flag directly, let's use dedicated method on a constraint system to determine whether closure did participate in inference or not.
1 parent 35c24bc commit bbdbb47

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/Sema/CSApply.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8002,6 +8002,8 @@ namespace {
80028002
/// \returns true if any part of the processing fails.
80038003
bool processDelayed() {
80048004
bool hadError = false;
8005+
auto &solution = Rewriter.solution;
8006+
auto &cs = solution.getConstraintSystem();
80058007

80068008
while (!ClosuresToTypeCheck.empty()) {
80078009
auto *closure = ClosuresToTypeCheck.pop_back_val();
@@ -8013,10 +8015,7 @@ namespace {
80138015
// as a stack because multi-statement closures could
80148016
// have other multi-statement closures in the body.
80158017
auto &ctx = closure->getASTContext();
8016-
if (ctx.TypeCheckerOpts.EnableMultiStatementClosureInference) {
8017-
auto &solution = Rewriter.solution;
8018-
auto &cs = solution.getConstraintSystem();
8019-
8018+
if (cs.participatesInInference(closure)) {
80208019
hadError |= cs.applySolutionToBody(
80218020
solution, closure, Rewriter.dc,
80228021
[&](SolutionApplicationTarget target) {

0 commit comments

Comments
 (0)