mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge remote-tracking branch 'origin/main' into rebranch
This commit is contained in:
@@ -7312,24 +7312,13 @@ bool ConstraintSystem::participatesInInference(ClosureExpr *closure) const {
|
||||
if (getAppliedResultBuilderTransform(closure))
|
||||
return true;
|
||||
|
||||
if (closure->hasSingleExpressionBody())
|
||||
return true;
|
||||
|
||||
if (Options.contains(ConstraintSystemFlags::LeaveClosureBodyUnchecked))
|
||||
return false;
|
||||
|
||||
if (closure->hasEmptyBody())
|
||||
return false;
|
||||
|
||||
// If body is nested in a parent that has a function builder applied,
|
||||
// let's prevent inference until result builders.
|
||||
if (Options.contains(
|
||||
ConstraintSystemFlags::
|
||||
ClosuresInResultBuildersDontParticipateInInference)) {
|
||||
return !isInResultBuilderContext(closure);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
TypeVarBindingProducer::TypeVarBindingProducer(BindingSet &bindings)
|
||||
|
||||
Reference in New Issue
Block a user