Skip to content

Commit f7c4674

Browse files
committed
formatting
1 parent 6cd1fb2 commit f7c4674

File tree

3 files changed

+22
-20
lines changed

3 files changed

+22
-20
lines changed

lib/SILGen/SILGenDistributed.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,15 +1154,17 @@ void SILGenFunction::emitDistributedThunk(SILDeclRef thunk) {
11541154
subTypes.push_back(paramTy);
11551155

11561156
// --- Codable: Decodable
1157-
auto decodableRequirementTy =
1158-
ctx.getProtocol(KnownProtocolKind::Decodable); // FIXME(distributed): actually use SerializationRequirement
1157+
auto decodableRequirementTy = ctx.getProtocol(
1158+
KnownProtocolKind::Decodable); // FIXME(distributed): actually use
1159+
// SerializationRequirement
11591160
auto paramDecodableTypeConfRef = module->lookupConformance(
11601161
paramTy, decodableRequirementTy);
11611162
subConformances.push_back(paramDecodableTypeConfRef);
11621163

11631164
// --- Codable: Encodable
11641165
auto encodableRequirementTy = ctx.getProtocol(
1165-
KnownProtocolKind::Encodable); // FIXME(distributed): actually use SerializationRequirement
1166+
KnownProtocolKind::Encodable); // FIXME(distributed): actually use
1167+
// SerializationRequirement
11661168
auto paramEncodableTypeConfRef = module->lookupConformance(
11671169
paramTy, encodableRequirementTy);
11681170
subConformances.push_back(paramEncodableTypeConfRef);

lib/Sema/TypeCheckDistributed.cpp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ bool swift::checkDistributedFunction(FuncDecl *func, bool diagnose) {
287287
auto declContext = func->getDeclContext();
288288
auto module = func->getParentModule();
289289

290-
// === All parameters and the result type must conform SerializationRequirement
290+
// === All parameters and the result type must conform
291+
// SerializationRequirement
291292
llvm::SmallPtrSet<ProtocolDecl *, 2> serializationRequirements;
292293
if (auto extension = dyn_cast<ExtensionDecl>(declContext)) {
293294
serializationRequirements = extractDistributedSerializationRequirements(
@@ -311,10 +312,10 @@ bool swift::checkDistributedFunction(FuncDecl *func, bool diagnose) {
311312
if (diagnose) {
312313
auto diag = func->diagnose(
313314
diag::distributed_actor_func_param_not_codable,
314-
param->getArgumentName().str(),
315-
param->getInterfaceType(),
315+
param->getArgumentName().str(), param->getInterfaceType(),
316316
func->getDescriptiveKind(),
317-
serializationRequirementIsCodable ? "Codable" : req->getNameStr());
317+
serializationRequirementIsCodable ? "Codable"
318+
: req->getNameStr());
318319

319320
if (auto paramNominalTy = paramTy->getAnyNominal()) {
320321
addCodableFixIt(paramNominalTy, diag);
@@ -532,9 +533,11 @@ swift::getDistributedSerializationRequirementProtocols(NominalTypeDecl *nominal)
532533
}
533534

534535
llvm::SmallPtrSet<ProtocolDecl *, 2>
535-
swift::flattenDistributedSerializationTypeToRequiredProtocols(TypeBase *serializationRequirement) {
536+
swift::flattenDistributedSerializationTypeToRequiredProtocols(
537+
TypeBase *serializationRequirement) {
536538
llvm::SmallPtrSet<ProtocolDecl *, 2> serializationReqs;
537-
if (auto composition = serializationRequirement->getAs<ProtocolCompositionType>()) {
539+
if (auto composition =
540+
serializationRequirement->getAs<ProtocolCompositionType>()) {
538541
for (auto member : composition->getMembers()) {
539542
if (auto *protocol = member->getAs<ProtocolType>())
540543
serializationReqs.insert(protocol->getDecl());
@@ -559,15 +562,13 @@ bool swift::checkDistributedSerializationRequirementIsExactlyCodable(
559562

560563
llvm::SmallPtrSet<ProtocolDecl *, 2>
561564
swift::extractDistributedSerializationRequirements(
562-
ASTContext &C,
563-
ArrayRef<Requirement> allRequirements) {
565+
ASTContext &C, ArrayRef<Requirement> allRequirements) {
564566
llvm::SmallPtrSet<ProtocolDecl *, 2> serializationReqs;
565567

566568
auto systemProto = C.getProtocol(KnownProtocolKind::DistributedActorSystem);
567569
auto serializationReqAssocType =
568570
systemProto->getAssociatedType(C.Id_SerializationRequirement);
569-
auto systemSerializationReqTy =
570-
serializationReqAssocType->getInterfaceType();
571+
auto systemSerializationReqTy = serializationReqAssocType->getInterfaceType();
571572

572573
for (auto req : allRequirements) {
573574
if (req.getSecondType()->isAny()) {
@@ -576,17 +577,18 @@ swift::extractDistributedSerializationRequirements(
576577
if (!req.getFirstType()->hasDependentMember())
577578
continue;
578579

579-
if (auto dependentMemberType = req.getFirstType()->castTo<DependentMemberType>()) {
580+
if (auto dependentMemberType =
581+
req.getFirstType()->castTo<DependentMemberType>()) {
580582
auto dependentTy =
581583
dependentMemberType->getAssocType()->getInterfaceType();
582584

583585
if (dependentTy->isEqual(systemSerializationReqTy)) {
584586
auto requirementProto = req.getSecondType();
585-
if (auto proto = dyn_cast_or_null<ProtocolDecl>(requirementProto->getAnyNominal())) {
587+
if (auto proto = dyn_cast_or_null<ProtocolDecl>(
588+
requirementProto->getAnyNominal())) {
586589
serializationReqs.insert(proto);
587590
} else {
588-
auto serialReqType = requirementProto
589-
->castTo<ExistentialType>()
591+
auto serialReqType = requirementProto->castTo<ExistentialType>()
590592
->getConstraintType()
591593
->getDesugaredType();
592594
auto flattenedRequirements =

lib/Sema/TypeCheckDistributed.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ bool checkDistributedSerializationRequirementIsExactlyCodable(
9696
/// return type checking of distributed targets.
9797
llvm::SmallPtrSet<ProtocolDecl *, 2>
9898
extractDistributedSerializationRequirements(
99-
ASTContext &C,
100-
ArrayRef<Requirement> allRequirements);
101-
99+
ASTContext &C, ArrayRef<Requirement> allRequirements);
102100

103101
/// Diagnose a distributed func declaration in a not-distributed actor protocol.
104102
void diagnoseDistributedFunctionInNonDistributedActorProtocol(

0 commit comments

Comments
 (0)