Skip to content

Commit 4b5c5ac

Browse files
committed
[Distributed] Teach HasIsolatedSelfRequest about distributed thunk accessors
1 parent c0cea20 commit 4b5c5ac

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
@@ -3918,8 +3918,13 @@ bool HasIsolatedSelfRequest::evaluate(
39183918
return false;
39193919

39203920
// For accessors, consider the storage declaration.
3921-
if (auto accessor = dyn_cast<AccessorDecl>(value))
3922-
value = accessor->getStorage();
3921+
if (auto accessor = dyn_cast<AccessorDecl>(value)) {
3922+
// distributed thunks are accessors only in spirit and
3923+
// should be handled as regular functions from isolation
3924+
// perspective.
3925+
if (!accessor->isDistributedThunk())
3926+
value = accessor->getStorage();
3927+
}
39233928

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

0 commit comments

Comments
 (0)