Skip to content

Commit 34a0b09

Browse files
committed
[ConstraintSystem] NFC: Format code related to InferSendableFromCaptures feature
1 parent 8d7b1a4 commit 34a0b09

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9536,9 +9536,7 @@ performMemberLookup(ConstraintKind constraintKind, DeclNameRef memberName,
95369536
// where the base type has a conditional Sendable conformance
95379537
if (Context.LangOpts.hasFeature(Feature::InferSendableFromCaptures)) {
95389538
if (isPartialApplication(memberLocator)) {
9539-
auto sendableProtocol =
9540-
Context.getProtocol(
9541-
KnownProtocolKind::Sendable);
9539+
auto sendableProtocol = Context.getProtocol(KnownProtocolKind::Sendable);
95429540
auto baseConformance = DC->getParentModule()->lookupConformance(
95439541
instanceTy, sendableProtocol);
95449542

@@ -9548,9 +9546,11 @@ performMemberLookup(ConstraintKind constraintKind, DeclNameRef memberName,
95489546
if (req.getKind() != RequirementKind::Conformance)
95499547
return false;
95509548

9551-
if (auto protocolTy = req.getSecondType()->template getAs<ProtocolType>()) {
9549+
if (auto protocolTy =
9550+
req.getSecondType()->template getAs<ProtocolType>()) {
95529551
return req.getFirstType()->hasTypeVariable() &&
9553-
protocolTy->getDecl()->isSpecificProtocol(KnownProtocolKind::Sendable);
9552+
protocolTy->getDecl()->isSpecificProtocol(
9553+
KnownProtocolKind::Sendable);
95549554
}
95559555
return false;
95569556
})) {

lib/Sema/ConstraintSystem.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,7 +1713,8 @@ ConstraintSystem::getTypeOfReference(ValueDecl *value,
17131713

17141714
if (Context.LangOpts.hasFeature(Feature::InferSendableFromCaptures)) {
17151715
// All global functions should be @Sendable
1716-
if (!funcDecl->getDeclContext()->isTypeContext() && !funcDecl->getDeclContext()->isLocalContext() ) {
1716+
if (!funcDecl->getDeclContext()->isTypeContext() &&
1717+
!funcDecl->getDeclContext()->isLocalContext()) {
17171718
funcType =
17181719
funcType->withExtInfo(funcType->getExtInfo().withConcurrent());
17191720
}
@@ -1722,7 +1723,9 @@ ConstraintSystem::getTypeOfReference(ValueDecl *value,
17221723
auto openedType = openFunctionType(funcType, locator, replacements,
17231724
funcDecl->getDeclContext())
17241725
->removeArgumentLabels(numLabelsToRemove);
1725-
openedType = unwrapPropertyWrapperParameterTypes(*this, funcDecl, functionRefKind, openedType->castTo<FunctionType>(), locator);
1726+
openedType = unwrapPropertyWrapperParameterTypes(
1727+
*this, funcDecl, functionRefKind, openedType->castTo<FunctionType>(),
1728+
locator);
17261729

17271730
auto origOpenedType = openedType;
17281731
if (!isRequirementOrWitness(locator)) {
@@ -2677,7 +2680,10 @@ ConstraintSystem::getTypeOfMemberReference(
26772680
if (isPartialApplication(locator) &&
26782681
isSendableType(DC->getParentModule(), baseOpenedTy)) {
26792682
// Add @Sendable to functions without conditional conformances
2680-
functionType = functionType->withExtInfo(functionType->getExtInfo().withConcurrent())->getAs<FunctionType>();
2683+
functionType =
2684+
functionType
2685+
->withExtInfo(functionType->getExtInfo().withConcurrent())
2686+
->getAs<FunctionType>();
26812687
}
26822688
// Unapplied values should always be Sendable
26832689
info = info.withConcurrent();

0 commit comments

Comments
 (0)