@@ -5083,8 +5083,6 @@ Optional<KnownDerivableProtocolKind>
5083
5083
return KnownDerivableProtocolKind::AdditiveArithmetic;
5084
5084
case KnownProtocolKind::Differentiable:
5085
5085
return KnownDerivableProtocolKind::Differentiable;
5086
- case KnownProtocolKind::Actor:
5087
- return KnownDerivableProtocolKind::Actor;
5088
5086
default : return None;
5089
5087
}
5090
5088
}
@@ -7559,56 +7557,6 @@ bool FuncDecl::isMainTypeMainMethod() const {
7559
7557
getParameters ()->size () == 0 ;
7560
7558
}
7561
7559
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
-
7612
7560
ConstructorDecl::ConstructorDecl (DeclName Name, SourceLoc ConstructorLoc,
7613
7561
bool Failable, SourceLoc FailabilityLoc,
7614
7562
bool Throws,
@@ -8003,17 +7951,6 @@ Type TypeBase::getSwiftNewtypeUnderlyingType() {
8003
7951
}
8004
7952
8005
7953
bool 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
-
8017
7954
return false ;
8018
7955
}
8019
7956
0 commit comments