@@ -5083,8 +5083,6 @@ Optional<KnownDerivableProtocolKind>
50835083 return KnownDerivableProtocolKind::AdditiveArithmetic;
50845084 case KnownProtocolKind::Differentiable:
50855085 return KnownDerivableProtocolKind::Differentiable;
5086- case KnownProtocolKind::Actor:
5087- return KnownDerivableProtocolKind::Actor;
50885086 default : return None;
50895087 }
50905088}
@@ -7559,56 +7557,6 @@ bool FuncDecl::isMainTypeMainMethod() const {
75597557 getParameters ()->size () == 0 ;
75607558}
75617559
7562- bool FuncDecl::isEnqueuePartialTaskName (ASTContext &ctx, DeclName name) {
7563- if (name.isCompoundName () && name.getBaseName () == ctx.Id_enqueue ) {
7564- auto argumentNames = name.getArgumentNames ();
7565- return argumentNames.size () == 1 && argumentNames[0 ] == ctx.Id_partialTask ;
7566- }
7567-
7568- return false ;
7569- }
7570-
7571- bool FuncDecl::isActorEnqueuePartialTaskWitness () const {
7572- if (!isEnqueuePartialTaskName (getASTContext (), getName ()))
7573- return false ;
7574-
7575- auto classDecl = getDeclContext ()->getSelfClassDecl ();
7576- if (!classDecl)
7577- return false ;
7578-
7579- if (!classDecl->isActor ())
7580- return false ;
7581-
7582- ASTContext &ctx = getASTContext ();
7583- auto actorProto = ctx.getProtocol (KnownProtocolKind::Actor);
7584- if (!actorProto)
7585- return false ;
7586-
7587- FuncDecl *requirement = nullptr ;
7588- for (auto protoMember : actorProto->getParsedMembers ()) {
7589- if (auto protoFunc = dyn_cast<FuncDecl>(protoMember)) {
7590- if (isEnqueuePartialTaskName (ctx, protoFunc->getName ())) {
7591- requirement = protoFunc;
7592- break ;
7593- }
7594- }
7595- }
7596-
7597- if (!requirement)
7598- return false ;
7599-
7600- SmallVector<ProtocolConformance *, 1 > conformances;
7601- classDecl->lookupConformance (
7602- classDecl->getModuleContext (), actorProto, conformances);
7603- for (auto conformance : conformances) {
7604- auto witness = conformance->getWitnessDecl (requirement);
7605- if (witness == this )
7606- return true ;
7607- }
7608-
7609- return false ;
7610- }
7611-
76127560ConstructorDecl::ConstructorDecl (DeclName Name, SourceLoc ConstructorLoc,
76137561 bool Failable, SourceLoc FailabilityLoc,
76147562 bool Throws,
@@ -8003,17 +7951,6 @@ Type TypeBase::getSwiftNewtypeUnderlyingType() {
80037951}
80047952
80057953bool ClassDecl::hasExplicitCustomActorMethods () const {
8006- auto &ctx = getASTContext ();
8007- for (auto member: getMembers ()) {
8008- if (member->isImplicit ()) continue ;
8009-
8010- // Methods called enqueue(partialTask:)
8011- if (auto func = dyn_cast<FuncDecl>(member)) {
8012- if (FuncDecl::isEnqueuePartialTaskName (ctx, func->getName ()))
8013- return true ;
8014- }
8015- }
8016-
80177954 return false ;
80187955}
80197956
0 commit comments