Skip to content

Commit 3ef125b

Browse files
authored
Merge pull request #66841 from ktoso/wip-distributed-non-file-checking-properties
[Distributed] Don't diagnose declared dist member properties when importing module
2 parents d3ce401 + e33ddaa commit 3ef125b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/Sema/TypeCheckDistributed.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -657,9 +657,13 @@ bool swift::checkDistributedActorProperty(VarDecl *var, bool diagnose) {
657657
void swift::checkDistributedActorProperties(const NominalTypeDecl *decl) {
658658
auto &C = decl->getASTContext();
659659

660-
auto sourceFile = decl->getDeclContext()->getParentSourceFile();
661-
if (sourceFile && sourceFile->Kind == SourceFileKind::Interface) {
662-
// Don't diagnose properties in swiftinterfaces.
660+
if (auto sourceFile = decl->getDeclContext()->getParentSourceFile()) {
661+
if (sourceFile->Kind == SourceFileKind::Interface) {
662+
// Don't diagnose properties in swiftinterfaces.
663+
return;
664+
}
665+
} else {
666+
// Don't diagnose when checking without source file (e.g. from module, importer etc).
663667
return;
664668
}
665669

0 commit comments

Comments
 (0)