Skip to content

Commit 8925f9d

Browse files
committed
[Distributed] recordErrorType is not ad-hoc requirement anymore
1 parent 14bbd27 commit 8925f9d

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

lib/Sema/TypeCheckDistributed.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -310,22 +310,7 @@ bool swift::checkDistributedActorSystemAdHocProtocolRequirements(
310310
}
311311
if (checkAdHocRequirementAccessControl(decl, Proto, recordArgumentDecl))
312312
anyMissingAdHocRequirements = true;
313-
314-
// - recordErrorType
315-
auto recordErrorTypeDecl = C.getRecordErrorTypeOnDistributedInvocationEncoder(decl);
316-
if (!recordErrorTypeDecl) {
317-
auto identifier = C.Id_recordErrorType;
318-
decl->diagnose(
319-
diag::distributed_actor_system_conformance_missing_adhoc_requirement,
320-
decl->getDescriptiveKind(), decl->getName(), identifier);
321-
decl->diagnose(diag::note_distributed_actor_system_conformance_missing_adhoc_requirement,
322-
decl->getName(), identifier,
323-
"mutating func recordErrorType<Err: Error>(_ errorType: Err.Type) throws\n");
324-
anyMissingAdHocRequirements = true;
325-
}
326-
if (checkAdHocRequirementAccessControl(decl, Proto, recordErrorTypeDecl))
327-
anyMissingAdHocRequirements = true;
328-
313+
329314
// - recordReturnType
330315
auto recordReturnTypeDecl = C.getRecordReturnTypeOnDistributedInvocationEncoder(decl);
331316
if (!recordReturnTypeDecl) {

stdlib/public/Distributed/DistributedActorSystem.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,9 @@ public protocol DistributedTargetInvocationEncoder {
407407
// mutating func recordArgument<Argument: SerializationRequirement>(_ argument: Argument) throws
408408
// TODO(distributed): offer recordArgument(label:type:)
409409

410-
// /// Ad-hoc requirement
411-
// ///
412-
// /// Record the error type of the distributed method.
413-
// /// This method will not be invoked if the target is not throwing.
414-
// mutating func recordErrorType<E: Error>(_ type: E.Type) throws // TODO: make not adhoc
410+
/// Record the error type of the distributed method.
411+
/// This method will not be invoked if the target is not throwing.
412+
mutating func recordErrorType<E: Error>(_ type: E.Type) throws
415413

416414
// /// Ad-hoc requirement
417415
// ///

0 commit comments

Comments
 (0)