@@ -4251,12 +4251,29 @@ GetDestructorRequest::evaluate(Evaluator &evaluator, ClassDecl *CD) const {
4251
4251
}
4252
4252
4253
4253
bool ClassDecl::isDefaultActor () const {
4254
+ return isDefaultActor (getModuleContext (), ResilienceExpansion::Minimal);
4255
+ }
4256
+
4257
+ bool ClassDecl::isDefaultActor (ModuleDecl *M,
4258
+ ResilienceExpansion expansion) const {
4254
4259
auto mutableThis = const_cast <ClassDecl *>(this );
4255
4260
return evaluateOrDefault (getASTContext ().evaluator ,
4256
- IsDefaultActorRequest{mutableThis},
4261
+ IsDefaultActorRequest{mutableThis, M,
4262
+ expansion},
4257
4263
false );
4258
4264
}
4259
4265
4266
+ const ClassDecl *ClassDecl::getRootActorClass () const {
4267
+ if (!isActor ()) return nullptr ;
4268
+ auto cur = this ;
4269
+ while (true ) {
4270
+ auto super = cur->getSuperclassDecl ();
4271
+ if (!super || !super->isActor ())
4272
+ return cur;
4273
+ cur = super;
4274
+ }
4275
+ }
4276
+
4260
4277
bool ClassDecl::hasMissingDesignatedInitializers () const {
4261
4278
return evaluateOrDefault (
4262
4279
getASTContext ().evaluator ,
@@ -8056,7 +8073,12 @@ bool ClassDecl::hasExplicitCustomActorMethods() const {
8056
8073
}
8057
8074
8058
8075
bool ClassDecl::isRootDefaultActor () const {
8059
- if (!isDefaultActor ()) return false ;
8076
+ return isRootDefaultActor (getModuleContext (), ResilienceExpansion::Minimal);
8077
+ }
8078
+
8079
+ bool ClassDecl::isRootDefaultActor (ModuleDecl *M,
8080
+ ResilienceExpansion expansion) const {
8081
+ if (!isDefaultActor (M, expansion)) return false ;
8060
8082
auto superclass = getSuperclassDecl ();
8061
8083
return (!superclass || superclass->isNSObject ());
8062
8084
}
0 commit comments