[ConstraintSystem] NFC: Format code related to InferSendableFromCaptures feature

This commit is contained in:
Pavel Yaskevich
2023-11-16 10:42:26 -08:00
parent 8d7b1a44c4
commit 34a0b09889
2 changed files with 14 additions and 8 deletions

View File

@@ -1713,7 +1713,8 @@ ConstraintSystem::getTypeOfReference(ValueDecl *value,
if (Context.LangOpts.hasFeature(Feature::InferSendableFromCaptures)) {
// All global functions should be @Sendable
if (!funcDecl->getDeclContext()->isTypeContext() && !funcDecl->getDeclContext()->isLocalContext() ) {
if (!funcDecl->getDeclContext()->isTypeContext() &&
!funcDecl->getDeclContext()->isLocalContext()) {
funcType =
funcType->withExtInfo(funcType->getExtInfo().withConcurrent());
}
@@ -1722,7 +1723,9 @@ ConstraintSystem::getTypeOfReference(ValueDecl *value,
auto openedType = openFunctionType(funcType, locator, replacements,
funcDecl->getDeclContext())
->removeArgumentLabels(numLabelsToRemove);
openedType = unwrapPropertyWrapperParameterTypes(*this, funcDecl, functionRefKind, openedType->castTo<FunctionType>(), locator);
openedType = unwrapPropertyWrapperParameterTypes(
*this, funcDecl, functionRefKind, openedType->castTo<FunctionType>(),
locator);
auto origOpenedType = openedType;
if (!isRequirementOrWitness(locator)) {
@@ -2677,7 +2680,10 @@ ConstraintSystem::getTypeOfMemberReference(
if (isPartialApplication(locator) &&
isSendableType(DC->getParentModule(), baseOpenedTy)) {
// Add @Sendable to functions without conditional conformances
functionType = functionType->withExtInfo(functionType->getExtInfo().withConcurrent())->getAs<FunctionType>();
functionType =
functionType
->withExtInfo(functionType->getExtInfo().withConcurrent())
->getAs<FunctionType>();
}
// Unapplied values should always be Sendable
info = info.withConcurrent();