File tree Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Original file line number Diff line number Diff line change @@ -87,23 +87,12 @@ void swift::addAsyncNotes(AbstractFunctionDecl const* func) {
8787
8888bool IsActorRequest::evaluate (
8989 Evaluator &evaluator, NominalTypeDecl *nominal) const {
90- // Protocols are actors if their `Self` type conforms to `Actor`.
90+ // Protocols are actors if they inherit from `Actor`.
9191 if (auto protocol = dyn_cast<ProtocolDecl>(nominal)) {
92- // Simple case: we have the Actor protocol itself.
93- if (protocol->isSpecificProtocol (KnownProtocolKind::Actor))
94- return true ;
95-
96- auto actorProto = nominal->getASTContext ().getProtocol (
97- KnownProtocolKind::Actor);
98- if (!actorProto)
99- return false ;
100-
101- auto selfType = Type (protocol->getProtocolSelfType ());
102- auto genericSig = protocol->getGenericSignature ();
103- if (!genericSig)
104- return false ;
105-
106- return genericSig->requiresProtocol (selfType, actorProto);
92+ auto &ctx = protocol->getASTContext ();
93+ auto *actorProtocol = ctx.getProtocol (KnownProtocolKind::Actor);
94+ return (protocol == actorProtocol ||
95+ protocol->inheritsFrom (actorProtocol));
10796 }
10897
10998 // Class declarations are actors if they were declared with "actor".
You can’t perform that action at this time.
0 commit comments