Skip to content

Commit 474aa2e

Browse files
committed
Loosen up distributed actor isolation checking.
1 parent 4bcd74e commit 474aa2e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2338,8 +2338,15 @@ namespace {
23382338
// FIXME: We can collapse a much of this with the ActorSelf case.
23392339
bool continueToCheckingLocalIsolation = false;
23402340
// Must reference distributed actor-isolated state on 'self'.
2341+
//
2342+
// FIXME: For now, be loose about access to "self" in actor
2343+
// initializers/deinitializers. We'll want to tighten this up once
2344+
// we decide exactly how the model should go.
23412345
auto isolatedActor = getIsolatedActor(base);
2342-
if (!isolatedActor) {
2346+
if (!isolatedActor &&
2347+
!(isolatedActor.isActorSelf() &&
2348+
member->isInstanceMember() &&
2349+
isActorInitOrDeInitContext(getDeclContext()))) {
23432350
// invocation on not-'self', is only okey if this is a distributed func
23442351

23452352
if (auto func = dyn_cast<FuncDecl>(member)) {

0 commit comments

Comments
 (0)