Skip to content

Commit 9087613

Browse files
committed
[CSApply] Set types for for all delayed closures
1 parent bc14f00 commit 9087613

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Sema/CSApply.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6113,9 +6113,9 @@ static bool applyTypeToClosureExpr(ConstraintSystem &cs,
61136113
if (auto CE = dyn_cast<ClosureExpr>(expr)) {
61146114
cs.setType(CE, toType);
61156115

6116-
// If this closure isn't type-checked in its enclosing expression, write
6117-
// the type into the ClosureExpr directly here, since the visitor won't.
6118-
if (!shouldTypeCheckInEnclosingExpression(CE))
6116+
// If solution application for this closure is delayed, let's write the
6117+
// type into the ClosureExpr directly here, since the visitor won't.
6118+
if (!CE->hasSingleExpressionBody())
61196119
CE->setType(toType);
61206120

61216121
return true;

0 commit comments

Comments
 (0)