Skip to content

Commit 8be1d56

Browse files
committed
fix body kind issue [squash me]
1 parent b9deb9c commit 8be1d56

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
@@ -2817,6 +2817,13 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
28172817
return false;
28182818
}
28192819

2820+
// do not skip the body of an actor initializer.
2821+
// they are checked to determine delegation status
2822+
if (auto *ctor = dyn_cast<ConstructorDecl>(AFD))
2823+
if (auto *nom = ctor->getParent()->getSelfNominalTypeDecl())
2824+
if (nom->isAnyActor())
2825+
return false;
2826+
28202827
// Skipping all bodies won't serialize anything, so can skip regardless
28212828
if (getASTContext().TypeCheckerOpts.SkipFunctionBodies ==
28222829
FunctionBodySkipping::All)

0 commit comments

Comments
 (0)