File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -387,6 +387,10 @@ bool swift::checkDistributedSerializationRequirementIsExactlyCodable(
387387bool AbstractFunctionDecl::isDistributedActorSystemRemoteCall (bool isVoidReturn) const {
388388 auto &C = getASTContext ();
389389 auto module = getParentModule ();
390+ auto *DC = getDeclContext ();
391+
392+ if (!DC->isTypeContext () || !isGeneric ())
393+ return false ;
390394
391395 // === Check the name
392396 auto callId = isVoidReturn ? C.Id_remoteCallVoid : C.Id_remoteCall ;
@@ -398,7 +402,7 @@ bool AbstractFunctionDecl::isDistributedActorSystemRemoteCall(bool isVoidReturn)
398402 ProtocolDecl *systemProto =
399403 C.getDistributedActorSystemDecl ();
400404
401- auto systemNominal = getDeclContext () ->getSelfNominalTypeDecl ();
405+ auto systemNominal = DC ->getSelfNominalTypeDecl ();
402406 auto distSystemConformance = module ->lookupConformance (
403407 systemNominal->getDeclaredInterfaceType (), systemProto);
404408
You can’t perform that action at this time.
0 commit comments