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) {
87
87
88
88
bool IsActorRequest::evaluate (
89
89
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`.
91
91
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));
107
96
}
108
97
109
98
// Class declarations are actors if they were declared with "actor".
You can’t perform that action at this time.
0 commit comments