Skip to content

Commit c480432

Browse files
committed
Configure option at call site instead
1 parent 10878e8 commit c480432

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7115,7 +7115,7 @@ bool ConstraintSystem::participatesInInference(ClosureExpr *closure) const {
71157115

71167116
// If body is nested in a parent that has a function builder applied,
71177117
// let's prevent inference until result builders.
7118-
if (isForCodeCompletion() && Options.contains(
7118+
if (Options.contains(
71197119
ConstraintSystemFlags::
71207120
ClosuresInResultBuildersDontParticipateInInference)) {
71217121
return !isInResultBuilderContext(closure);

lib/Sema/TypeCheckStmt.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2649,7 +2649,9 @@ TypeCheckFunctionBodyRequest::evaluate(Evaluator &evaluator,
26492649
if (Type builderType = getResultBuilderType(func)) {
26502650
if (auto optBody =
26512651
TypeChecker::applyResultBuilderBodyTransform(
2652-
func, builderType)) {
2652+
func, builderType,
2653+
/*ClosuresInResultBuilderDontParticipateInInference=*/
2654+
false)) {
26532655
if (!*optBody)
26542656
return errorBody();
26552657

0 commit comments

Comments
 (0)