Skip to content

Commit e800b4a

Browse files
authored
Merge pull request #40682 from DougGregor/unowned-executor-anywhere-5.6
Eliminate unnecessary restriction for unownedExecutor to main actor definition
2 parents b59cd0d + 6dc99d5 commit e800b4a

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4431,9 +4431,6 @@ ERROR(distributed_actor_protocol_illegal_inheritance,none,
44314431
ERROR(broken_distributed_actor_requirement,none,
44324432
"DistributedActor protocol is broken: unexpected requirement", ())
44334433

4434-
ERROR(unowned_executor_outside_actor,none,
4435-
"'unownedExecutor' can only be implemented within the main "
4436-
"definition of an actor", ())
44374434
ERROR(override_implicit_unowned_executor,none,
44384435
"cannot override an actor's 'unownedExecutor' property that wasn't "
44394436
"explicitly defined", ())

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4924,19 +4924,6 @@ void ConformanceChecker::resolveValueWitnesses() {
49244924
if (checkActorIsolation(requirement, witness))
49254925
return;
49264926

4927-
// Ensure that Actor.unownedExecutor is implemented within the
4928-
// actor class itself. But if this somehow resolves to the
4929-
// requirement, ignore it.
4930-
if (requirement->getName().isSimpleName(C.Id_unownedExecutor) &&
4931-
Proto->isSpecificProtocol(KnownProtocolKind::Actor) &&
4932-
DC != witness->getDeclContext() &&
4933-
!isa<ProtocolDecl>(witness->getDeclContext()) &&
4934-
Adoptee->getClassOrBoundGenericClass() &&
4935-
Adoptee->getClassOrBoundGenericClass()->isActor()) {
4936-
witness->diagnose(diag::unowned_executor_outside_actor);
4937-
return;
4938-
}
4939-
49404927
// Objective-C checking for @objc requirements.
49414928
if (requirement->isObjC() &&
49424929
requirement->getName() == witness->getName() &&

0 commit comments

Comments
 (0)