Skip to content

Commit 70af76f

Browse files
committed
fix body kind issue [squash me]
1 parent 5b14344 commit 70af76f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/Sema/TypeCheckDeclPrimary.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2826,6 +2826,13 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
28262826
return false;
28272827
}
28282828

2829+
// do not skip the body of an actor initializer.
2830+
// they are checked to determine delegation status
2831+
if (auto *ctor = dyn_cast<ConstructorDecl>(AFD))
2832+
if (auto *nom = ctor->getParent()->getSelfNominalTypeDecl())
2833+
if (nom->isAnyActor())
2834+
return false;
2835+
28292836
// Skipping all bodies won't serialize anything, so can skip regardless
28302837
if (getASTContext().TypeCheckerOpts.SkipFunctionBodies ==
28312838
FunctionBodySkipping::All)

0 commit comments

Comments
 (0)