@@ -689,11 +689,9 @@ class InheritedProtocolCollector {
689689 return ;
690690
691691 // / is this nominal specifically an 'actor' or 'distributed actor'?
692- bool actorClass = false ;
693- bool distributedActorClass = false ;
692+ bool anyActorClass = false ;
694693 if (auto klass = dyn_cast<ClassDecl>(nominal)) {
695- actorClass = klass->isActor ();
696- distributedActorClass = klass->isDistributedActor ();
694+ anyActorClass = klass->isAnyActor ();
697695 }
698696
699697 SmallPtrSet<ProtocolDecl *, 16 > handledProtocols;
@@ -729,12 +727,11 @@ class InheritedProtocolCollector {
729727 // There is a special restriction on the Actor protocol in that
730728 // it is only valid to conform to Actor on an 'actor' decl,
731729 // not extensions of that 'actor'.
732- if (actorClass &&
733- inherited->isSpecificProtocol (KnownProtocolKind::Actor))
734- return TypeWalker::Action::SkipNode;
735- if (distributedActorClass &&
736- inherited->isSpecificProtocol (KnownProtocolKind::DistributedActor))
737- return TypeWalker::Action::SkipNode;
730+ if (anyActorClass) {
731+ if (inherited->isSpecificProtocol (KnownProtocolKind::Actor) ||
732+ inherited->isSpecificProtocol (KnownProtocolKind::DistributedActor))
733+ return TypeWalker::Action::SkipNode;
734+ }
738735
739736 // Do not synthesize an extension to print a conformance to an
740737 // invertible protocol, as their conformances are always re-inferred
0 commit comments