Skip to content

Commit 9d5f546

Browse files
committed
[Distributed] Teach HasIsolatedSelfRequest about distributed thunk accessors
1 parent 13dbd37 commit 9d5f546

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3910,8 +3910,13 @@ bool HasIsolatedSelfRequest::evaluate(
39103910
return false;
39113911

39123912
// For accessors, consider the storage declaration.
3913-
if (auto accessor = dyn_cast<AccessorDecl>(value))
3914-
value = accessor->getStorage();
3913+
if (auto accessor = dyn_cast<AccessorDecl>(value)) {
3914+
// distributed thunks are accessors only in spirit and
3915+
// should be handled as regular functions from isolation
3916+
// perspective.
3917+
if (!accessor->isDistributedThunk())
3918+
value = accessor->getStorage();
3919+
}
39153920

39163921
// Check whether this member can be isolated to an actor at all.
39173922
auto memberIsolation = getMemberIsolationPropagation(value);

0 commit comments

Comments
 (0)